This seems like a silly solution but I found out how to do it.....
if(show_widget1)
{
widget1->setVisible(false);
p_dockwidget->addWidget(widget1);
widget1->setParent(p_dockwidget);
widget2->setParent(p_mainwindow);
widget1->setVisible(true);
}
else
{
widget2->setVisible(false);
p_dockwidget->addWidget(widget2);
widget2->setParent(p_dockwidget);
widget1->setParent(p_mainwindow);
widget2->setVisible(true);
}
if(show_widget1)
{
widget1->setVisible(false);
p_dockwidget->addWidget(widget1);
widget1->setParent(p_dockwidget);
widget2->setParent(p_mainwindow);
widget1->setVisible(true);
}
else
{
widget2->setVisible(false);
p_dockwidget->addWidget(widget2);
widget2->setParent(p_dockwidget);
widget1->setParent(p_mainwindow);
widget2->setVisible(true);
}
To copy to clipboard, switch view to plain text mode
Bookmarks