From: Soeren Apel Date: Thu, 18 Aug 2016 18:02:18 +0000 (+0200) Subject: MainWindow: Prevent Qt from restoring the dock widgets X-Git-Tag: pulseview-0.4.0~267 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=55547a4510d8ff310ab1ac57e69e3e51132b2c2f;p=pulseview.git MainWindow: Prevent Qt from restoring the dock widgets --- 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);