aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-01-12 09:08:18 +0200
committerKai Koehne <kai.koehne@digia.com>2014-01-13 11:51:08 +0100
commita97b449f2b862a9320276ec14249920bbdd5ee58 (patch)
tree418e8e701aaf2f0d6afea32d50ac216fb588acca /src
parent4ba5a058ae0fec4c3d03d202c30e5e13370bc062 (diff)
MainWindow: Delay restoreWindowState
QLayout calls setMinimumSize, which breaks maximized state on Windows. Task-number: QTCREATORBUG-9586 Change-Id: Ibd9ceb8bccbdf26c6369e86ad4918835d645ca1e Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp14
-rw-r--r--src/plugins/coreplugin/mainwindow.h1
2 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 07b03abf3c..5d31975ed5 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -1077,9 +1077,8 @@ void MainWindow::readSettings()
QColor(Utils::StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>());
}
- if (!restoreGeometry(m_settings->value(QLatin1String(windowGeometryKey)).toByteArray()))
- resize(1008, 700); // size without window decoration
- restoreState(m_settings->value(QLatin1String(windowStateKey)).toByteArray());
+ // Delay restoreWindowState, since it is overridden by LayoutRequest event
+ QTimer::singleShot(0, this, SLOT(restoreWindowState()));
bool modeSelectorVisible = m_settings->value(QLatin1String(modeSelectorVisibleKey), true).toBool();
ModeManager::setModeSelectorVisible(modeSelectorVisible);
@@ -1262,3 +1261,12 @@ bool MainWindow::showWarningWithOptions(const QString &title,
return showOptionsDialog(settingsCategory, settingsId);
return false;
}
+
+void MainWindow::restoreWindowState()
+{
+ m_settings->beginGroup(QLatin1String(settingsGroup));
+ if (!restoreGeometry(m_settings->value(QLatin1String(windowGeometryKey)).toByteArray()))
+ resize(1008, 700); // size without window decoration
+ restoreState(m_settings->value(QLatin1String(windowStateKey)).toByteArray());
+ m_settings->endGroup();
+}
diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h
index 93cbf6a026..323ad67de1 100644
--- a/src/plugins/coreplugin/mainwindow.h
+++ b/src/plugins/coreplugin/mainwindow.h
@@ -149,6 +149,7 @@ private slots:
void setSidebarVisible(bool visible);
void destroyVersionDialog();
void openDelayedFiles();
+ void restoreWindowState();
private:
void updateContextObject(const QList<IContext *> &context);