Results 1 to 2 of 2

Thread: Child Widget is hogging the MouseReleaseEvent

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Child Widget is hogging the MouseReleaseEvent

    I'm using a QRubberBand to select multiple child Widgets in the area of a parent Widget. When the mouse press and the release both occur in the parent's area everything works fine. Now if I press the mouse on a child widget and drag the rubber band out on the parent's area and release it there, the child gets the release event and not the parent.

    I tried explicitely ignoring the press event in the child and also releasing the mouse.

    Qt Code:
    1. void ChildWidget::mousePressEvent(QMouseEvent *event)
    2. {
    3. event->ignore();
    4. releaseMouse();
    5. }
    To copy to clipboard, switch view to plain text mode 

    It doesn't do the trick. It seems like generally the release event goes where the press event occured, even if the press was ignored. What can I do about this?

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Child Widget is hogging the MouseReleaseEvent

    Well, I installed an event filter. It does the job but it still feels more of a workaround than a solution.

Similar Threads

  1. removing child widget
    By db in forum Newbie
    Replies: 1
    Last Post: 16th August 2007, 12:19
  2. Qdialog as a child widget
    By dave in forum Newbie
    Replies: 12
    Last Post: 14th November 2006, 09:43
  3. minimize child widget
    By sreedhar in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2006, 12:02
  4. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:00
  5. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 15: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.