changeset 33:58f1b3c330af

(issue9) Show maximized by default If the Window geometry is not saved show maximized otherwise restore the Window state / geometry.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 06 May 2015 15:41:42 +0200
parents 179239c94740
children 40a683d1a318
files src/mainwindow.cpp
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Wed May 06 15:31:54 2015 +0200
+++ b/src/mainwindow.cpp	Wed May 06 15:41:42 2015 +0200
@@ -84,8 +84,10 @@
 }
 
 void MainWindow::readSettings() {
-    restoreGeometry(mSettings.value("geometry").toByteArray());
-    restoreState(mSettings.value("windowState").toByteArray());
+    if (mSettings.contains("geometry")) {
+        restoreGeometry(mSettings.value("geometry").toByteArray());
+        restoreState(mSettings.value("windowState").toByteArray());
+    }
 }
 /*
 void MainWindow::dragEnterEvent(QDragEnterEvent *event)
@@ -155,7 +157,13 @@
     mCurFolder = folder;
     mPlayer->setBaseDir(folder);
     mDataView->selectNextRow();
-    show();
+    if (!mSettings.contains("geometry")) {
+        qDebug() << "Showing maximized";
+        show();
+        showMaximized();
+    } else {
+        show();
+    }
 }
 
 void MainWindow::showPictureNameStatus(const QString& fileName, int current,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)