MainWindow: Prevent Qt from restoring the dock widgets
authorSoeren Apel <soeren@apelpie.net>
Thu, 18 Aug 2016 18:02:18 +0000 (20:02 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 18 Aug 2016 22:36:03 +0000 (00:36 +0200)
pv/mainwindow.cpp
pv/mainwindow.hpp

index 59f4369e2990ca902d15d1a0c3dc5fbcaea9b560..33870145232afdd654a750cac5046169d7051201 100644 (file)
@@ -812,6 +812,17 @@ QMenu* MainWindow::createPopupMenu()
        return nullptr;
 }
 
+bool MainWindow::restoreState(const QByteArray &state, int version)
+{
+       (void)state;
+       (void)version;
+
+       // Do nothing. We don't want Qt to handle this, or else it
+       // will try to restore all the dock widgets and create havoc.
+
+       return false;
+}
+
 void MainWindow::show_session_error(
        const QString text, const QString info_text)
 {
index 9a66b3452dc00292151d7c054b6be5627af6cc6c..618a10e0fb51b1097a2e3b91216dd0c46a5778ad 100644 (file)
@@ -150,6 +150,8 @@ private:
 
        virtual QMenu* createPopupMenu();
 
+       virtual bool restoreState(const QByteArray &state, int version = 0);
+
 private Q_SLOTS:
        void show_session_error(
                const QString text, const QString info_text);