[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Drag status message
From: "Ron Longo" <ron.longo () cox ! net>
Date: 2008-11-30 20:12:34
Message-ID: 37BFC059E8204C1AB6A34413BE64820E () aristotle
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18148" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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().</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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().</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Ron</FONT></DIV></BODY></HTML>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic