Results 1 to 2 of 2

Thread: QDockWidget flicker

  1. #1
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Post QDockWidget flicker

    So, I create a QDockWidget and then I have two different Widgets that I change depending on a view in the QDockWidget.

    Qt Code:
    1. if(show_widget1)
    2. {
    3. p_dockwidget->addWidget(widget1);
    4. widget1->setParent(p_dockwidget);
    5. widget2->setParent(p_mainwindow);
    6. }
    7. else
    8. {
    9. p_dockwidget->addWidget(widget2);
    10. widget2->setParent(p_dockwidget);
    11. widget1->setParent(p_mainwindow);
    12. }
    To copy to clipboard, switch view to plain text mode 

    The problem is that since the QDockWidget is already visible it loads the widget up on the toolbar then moves it to snap into a nice location. Is there a way to get rid of the flicker by making it snap into the nice location first?

  2. #2
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWidget flicker

    This seems like a silly solution but I found out how to do it.....
    Qt Code:
    1. if(show_widget1)
    2. {
    3. widget1->setVisible(false);
    4. p_dockwidget->addWidget(widget1);
    5. widget1->setParent(p_dockwidget);
    6. widget2->setParent(p_mainwindow);
    7. widget1->setVisible(true);
    8. }
    9. else
    10. {
    11. widget2->setVisible(false);
    12. p_dockwidget->addWidget(widget2);
    13. widget2->setParent(p_dockwidget);
    14. widget1->setParent(p_mainwindow);
    15. widget2->setVisible(true);
    16. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QDockWidget magically disapear
    By 1111 in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2009, 12:44
  2. widget not resized within QDockWidget
    By pospiech in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2008, 19:19
  3. QDockWidget closing detection
    By danielperaza in forum Qt Programming
    Replies: 1
    Last Post: 16th April 2008, 16:28
  4. Replies: 8
    Last Post: 4th February 2007, 01:42
  5. Flicker Problem
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 26th June 2006, 17:50

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.