Also I expect to recieve mouse release event (plus, any mouse moves between press and release events as well) even if item was not explicitly set as a mouse grabber.
2014-03-11 13:36 GMT+04:00 Dmitrii Volosnykh <dmitrii.volosn...@gmail.com>: > I'd like my custom item to become an explicit mouse grabber on mouse press > event. I call grabMouse() inside mousePressEvent() handler, but it does not > receive any consecutive mouse move and release events (imagine, I try to > drag this item). > > As far as I can see from QGraphicsScene's sources > QGraphicsScenePrivate::mousePressEventHandler() forwards mouse press event > to the item under cursor, making it implicit mouse grabber a priori. After > this mouse event was handled by the target item, the former one releases > mouse grabber state. While in general this seems to be okay, I expect this > custom item to keep mouse grabber state when it was set explicitly. Indeed, > what actually grabMouse() does, being called from mousePressEvent(), is > updates lastMouseGrabberItemHasImplicitMouseGrab flag to false. So, I > guess, ungrabMouse() should be called only in case item is still an > implicit mouse grabber. > > Does this suggestion make sense? Should the current behaviour be > considered as a false one? > > Regards, > Dmitrii. >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest