Results 1 to 3 of 3

Thread: QWidget not getting MouseButtonRelease event when embedded in QGraphicsScene

  1. #1
    Join Date
    Nov 2009
    Posts
    39
    Thanks
    9
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QWidget not getting MouseButtonRelease event when embedded in QGraphicsScene

    I started a thread in the Qwt subforum about this issue, but I've since realized that the issue is not Qwt specific. My Qwt thread is here:

    http://www.qtcentre.org/threads/5414...QGraphicsScene

    I've embedded a QWidget in a QGraphicsScene, and I'm trying to handle the MouseButtonPress and MouseButtonRelease events. The QWidget gets all events except MouseButtonRelease. For some reason, it's not getting propagated to the QWidget when it's embedded in a QGraphicsScene. I've tested the other mouse and keyboard events, and they all get propagated to the QWidget just fine. What's special about MouseButtonRelease?

    I'm using Qt 4.8 on Linux x86_64.

  2. #2
    Join Date
    Nov 2009
    Posts
    39
    Thanks
    9
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWidget not getting MouseButtonRelease event when embedded in QGraphicsScene

    Quick Update:

    The QGraphicsProxyWidget is supposed to forward events to its child widget. It converts a QGraphicsSceneMouseEvent to a QMouseEvent, and passes it along to the widget. However, it seems that the mouseReleaseEvent function is never executed in my QGraphicsProxyWidget instance, so the event doesn't get passed to the underlying widget.

    Anyone have any ideas?

  3. #3
    Join Date
    Nov 2009
    Posts
    39
    Thanks
    9
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWidget not getting MouseButtonRelease event when embedded in QGraphicsScene

    I found a solution. Please see my post in this thread:

    http://www.qtcentre.org/threads/5414...QGraphicsScene

Similar Threads

  1. Replies: 1
    Last Post: 15th January 2013, 19:08
  2. Replies: 0
    Last Post: 4th October 2010, 21:53
  3. Caching of QPushButton embedded in QGraphicsScene
    By matthias_ in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2010, 19:31
  4. Replies: 1
    Last Post: 30th October 2009, 08:52
  5. no MouseButtonRelease event for QComboBox
    By Beluvius in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2006, 12:58

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.