after restoreState add CDockWidget to center addDockWidget crash
gooker opened this issue · 2 comments
gooker commented
when no use restoreState function, everything is ok;
void MainWindow::saveState()
{
QSettings Settings("config.ini", QSettings::IniFormat);
Settings.setValue("mainWindow/Geometry", this->saveGeometry());
Settings.setValue("mainWindow/State", QMainWindow::saveState());
Settings.setValue("mainWindow/DockingState", m_DockManager->saveState());
}
//============================================================================
void MainWindow::restoreState()
{
QSettings Settings("config.ini", QSettings::IniFormat);
this->restoreGeometry(Settings.value("mainWindow/Geometry").toByteArray());
QMainWindow::restoreState(Settings.value("mainWindow/State").toByteArray());
m_DockManager->restoreState(Settings.value("mainWindow/DockingState").toByteArray());
}
//crash
m_DockManager->addDockWidget(ads::CenterDockWidgetArea, dock,CentralDockArea);
githubuser0xFFFF commented
Sorry, I do not understand your request. Check if it works in demo application.
gooker commented
@githubuser0xFFFF #629 Sorry, please check this