[Qt-interest] QGraphicsView::mouseMoveEvent not called after view tranform change (Qt-4.5.2)

Malyushytsky, Alex alex at wai.com
Fri Feb 5 00:25:00 CET 2010


You can create and send/post an event any time you need an update,
but there is no any reason for mouseMoveEvent to be generated,
if mouse was not moved, so I doubt QT will ever do it for you.

Mouse move is a result of mouse movement, nothing else.

It is a good idea to place the code which synchronize information you want to display with
current cursor position.

And if you need function synchronize () to be called when mouseMoveEvent is received,
view was moved or scaled, etc, make sure you call such function
one or another way ( from the MouseMoveEvent handler, from your custom slots, etc )
as a result of any such event.

Regards,
     Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of r
Sent: Wednesday, February 03, 2010 10:19 PM
To: qt-interest
Subject: [Qt-interest] QGraphicsView::mouseMoveEvent not called after view tranform change (Qt-4.5.2)

I'm reimplementing QGraphicsView::mouseMoveEvent to detect mouse hover
on certain items. This works fine unless I change the view transform
(e.g. move or rescale the view with a keyboard action). Since this
doesn't trigger the execution of the mouseMoveEvent method my visual
hover indicators are no longer in sync with the actual mouse cursor
position. Tested with Qt-4.5.2.

Would it be possible to emit such an event in future versions of Qt?
What would be the best work-around for Qt-4.5/4.6? I imagine I can
simply manually emit such an event from the code changing view
transform.

Cheers,
-r.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list