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?