Results 1 to 2 of 2

Thread: QTableView Mouse/Keyboard Events in QGraphicsProxyWidget

  1. #1
    Join Date
    Mar 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTableView Mouse/Keyboard Events in QGraphicsProxyWidget

    Hi,

    I've created a QTableView and populated it with a custom model. I need to display the table in a scene, so I've created a QGraphicsProxyWidget and set the QTableView as its widget. It displays reasonably fine...much fine-tuning to do, but the data is there, and my vertical scroll bar appears as intended.

    The problem I'm having is that the QTableView isn't getting any mouse or keyboard events. I can't grab the scroll bar, click on a column heading, select a cell, etc. Using page up/page down to scroll doesn't do anything either. I tried setting the ItemIsFocusable flag, but that didn't appear to make any difference.

    I experimented with a QTextEdit widget many months ago in a QGraphicsProxyWidget, and I don't recall any problems entering text into it without doing anything special, so I'm at a bit of a loss here.

    Suggestions?

    Thanks,
    Doug

  2. #2
    Join Date
    Mar 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView Mouse/Keyboard Events in QGraphicsProxyWidget

    I figured it out. At some point between my early prototype first learning Qt and my current work, I'd decided that all of my scene items needed to be children of a QGraphicsItemGroup. I've since realized that's not true and unworkable for some of the things I need to do, but I haven't gone back and reworked my derived classes to change the parent item to something else. The QGraphicsItemGroup is preventing the child items from receiving events, which is something I knew but had forgotten about. It's time to fix that up.

    Doug

Similar Threads

  1. Replies: 3
    Last Post: 8th October 2011, 09:46
  2. Can I use delegate to catch mouse and keyboard events
    By hubbobubbo in forum Qt Programming
    Replies: 0
    Last Post: 29th April 2010, 12:00
  3. QGraphicsProxyWidget and touch events
    By johnsoga in forum Qt Programming
    Replies: 0
    Last Post: 21st February 2010, 06:53
  4. Filtering all mouse/keyboard events
    By maverick_pol in forum Qt Programming
    Replies: 9
    Last Post: 27th November 2008, 17:03
  5. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.