Init Layout after loading Plugin UI (#1407)

* Init Layout after loading Plugin UI

* Make sure all Dock Widgets are part of the MainWindow
This commit is contained in:
Florian Märkl 2019-03-29 18:02:27 +01:00 committed by GitHub
parent 45698112c2
commit f514a1c3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,6 @@ void MainWindow::initUI()
initToolBar();
initDocks();
initLayout();
/*
* Some global shortcuts
@ -165,6 +164,8 @@ void MainWindow::initUI()
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
setDockOptions(dockOptions() | DockOption::GroupedDragging);
#endif
initLayout();
}
void MainWindow::initToolBar()
@ -455,7 +456,7 @@ void MainWindow::addPluginDockWidget(QDockWidget *dockWidget, QAction *action)
addDockWidget(Qt::TopDockWidgetArea, dockWidget);
addDockWidgetAction(dockWidget, action);
ui->menuPlugins->addAction(action);
tabifyDockWidget(dashboardDock, dockWidget);
addDockWidget(Qt::DockWidgetArea::TopDockWidgetArea, dockWidget);
updateDockActionChecked(action);
}
@ -646,6 +647,16 @@ void MainWindow::readSettingsOrDefault()
hideAllDocks();
restoreGeometry(geo);
restoreState(state);
// make sure all DockWidgets are part of the MainWindow
// also show them, so newly installed plugin widgets are shown right away
for (auto dockWidget : dockWidgets) {
if (dockWidgetArea(dockWidget) == Qt::DockWidgetArea::NoDockWidgetArea) {
addDockWidget(Qt::DockWidgetArea::TopDockWidgetArea, dockWidget);
dockWidget->show();
}
}
responsive = settings.value("responsive").toBool();
panelLock = settings.value("panelLock").toBool();
setPanelLock();