fellobo
28th April 2006, 20:01
So, I create a QDockWidget and then I have two different Widgets that I change depending on a view in the QDockWidget.
if(show_widget1)
{
p_dockwidget->addWidget(widget1);
widget1->setParent(p_dockwidget);
widget2->setParent(p_mainwindow);
}
else
{
p_dockwidget->addWidget(widget2);
widget2->setParent(p_dockwidget);
widget1->setParent(p_mainwindow);
}
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?
if(show_widget1)
{
p_dockwidget->addWidget(widget1);
widget1->setParent(p_dockwidget);
widget2->setParent(p_mainwindow);
}
else
{
p_dockwidget->addWidget(widget2);
widget2->setParent(p_dockwidget);
widget1->setParent(p_mainwindow);
}
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?