From 55547a4510d8ff310ab1ac57e69e3e51132b2c2f Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Thu, 18 Aug 2016 20:02:18 +0200 Subject: [PATCH] MainWindow: Prevent Qt from restoring the dock widgets --- pv/mainwindow.cpp | 11 +++++++++++ pv/mainwindow.hpp | 2 ++ 2 files changed, 13 insertions(+) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 59f4369e..33870145 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -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) { diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 9a66b345..618a10e0 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -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); -- 2.30.2