Results 1 to 2 of 2

Thread: processEvents causing multiple events

  1. #1
    Join Date
    Jun 2007
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default processEvents causing multiple events

    I have a QGraphicsView subclass. When the mouse is dragged over it and then leaves it, the QDragLeaveEvent triggers a timeline to animate hiding the QGV. The problem is that in another area in my program, I want to make sure that if the animation is running it finishes, so I put a

    Qt Code:
    1. while( fadeTimer.state() == QTimeLine::Running )
    2. QApplication::processEvents
    To copy to clipboard, switch view to plain text mode 

    What's happening is that this is causing multiple QDragLeaveEvents to get sent to my QGV, resulting in an eventual crash. Why am I getting these multiple events and how do I avoid it?

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: processEvents causing multiple events

    How about starting the action after QTimeLine::finished() has been emitted, instead of that nasty event processing loop?
    J-P Nurmi

Similar Threads

  1. How to suppress user defined events in processEvents()
    By Artschi in forum Qt Programming
    Replies: 5
    Last Post: 5th July 2007, 10:17
  2. processevents, filtering events
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2006, 22:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.