PDA

View Full Version : Child Widget is hogging the MouseReleaseEvent



Cruz
24th January 2009, 16:28
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.



void ChildWidget::mousePressEvent(QMouseEvent *event)
{
event->ignore();
releaseMouse();
}


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?

Cruz
24th January 2009, 19:28
Well, I installed an event filter. It does the job but it still feels more of a workaround than a solution.