[PyQt] Drag status message

Ron Longo ron.longo at cox.net
Sun Nov 30 20:12:34 GMT 2008


I've implemented my own drag operation in a view class.  In my mousePressEvent() I setup for possible drag event (e.g. save the location of the mouse press).  In mouseMoveEvent() if a drag is started (mouse button pressed and mouse moved) I initiate a drag event.  In this method I create a QDrag object then call its exec_() method.

During the drag operation I repeatedly get calls to my dragMoveEvent().  In this method, I want to check the position of the mouse cursor and update the status bar to provide user feedback.  I do this by calling self.setStatusTip().

When I run my application and perform a drag, I see nothing until the drag is completed.  I then see the status bar updated with the text passed to the last call made to setStatusTip().

The call to QDrag's exec_() method takes control of the drag operation until the drag is completed.  Once the drag is completed exec_() returns.  Is exec_() crating a separate event loop?  Is there any way to force the main event loop to update the GUI so that my status message will appear during the drag operation?

Thanks,
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081130/463a8344/attachment.html


More information about the PyQt mailing list