Results 1 to 3 of 3

Thread: Pop up menus disappear on repaint events

  1. #1
    Join Date
    Aug 2008
    Location
    Texas, USA
    Posts
    44
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Pop up menus disappear on repaint events

    I have a couple buttons that pop up a menu when clicked. I also have a qwt graph that is directly below the buttons. Sometimes when a user clicks a button the pop up menu will only flash briefly then get hidden (I assume when the graph repaints over it). This causes the user to have to click the button multiple times until the timing is just right.

    This same problem happens when you right click on the program in the Windows Taskbar. The system menu may show or may not show depending on what is getting drawn/updated at the time.

    Any thoughts on how to fix this?

    Thanks

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Pop up menus disappear on repaint events

    I've seen behavior like this which was directly related to the Unpredictable Exec blog post.

    Short summary, stop using QDialog::exec() and start using open() or show().
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Aug 2008
    Location
    Texas, USA
    Posts
    44
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Pop up menus disappear on repaint events

    Yeah i'm just using the default main() function that Visual Studio created.

    Qt Code:
    1. QApplication a(argc, argv);
    2. MainWidget w;
    3. w.show();
    4. return a.exec();
    To copy to clipboard, switch view to plain text mode 

    Is there a problem with doing that? The other thing is I'm using 4.6.0 Qt, so maybe this has already been fixed?

Similar Threads

  1. Can't get title bar to disappear from widget
    By MattPhillips in forum Qt Programming
    Replies: 11
    Last Post: 2nd November 2010, 15:41
  2. Replies: 4
    Last Post: 17th October 2010, 23:30
  3. Replies: 2
    Last Post: 2nd September 2010, 20:52
  4. Replies: 0
    Last Post: 18th July 2010, 17:53
  5. QTableView : headers disappear
    By xavier in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2006, 17:57

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.