OSDN Git Service

Move hide implementation of conditional show()
authorAlessandro Portale <alessandro.portale@nokia.com>
Mon, 1 Nov 2010 18:19:32 +0000 (19:19 +0100)
committerAlessandro Portale <alessandro.portale@nokia.com>
Mon, 1 Nov 2010 18:19:32 +0000 (19:19 +0100)
...and do not call it show(), because that is the signature of
a non-virtual base class function. showExpanded() sucks as name,
and hjk, who reviewed this is not convinced.
But showExpanded() is still better than show().

Task-Number: QTCREATORBUG-2979
Reviewed-By: hjk
share/qtcreator/templates/mobileapp/main.cpp
share/qtcreator/templates/mobileapp/mainwindow.cpp
share/qtcreator/templates/mobileapp/mainwindow.h
share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp
share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.h

index 355b1b1..0ba2a15 100644 (file)
@@ -8,13 +8,7 @@ int main(int argc, char *argv[])
 
     MainWindow mainWindow;
     mainWindow.setOrientation(MainWindow::ScreenOrientationAuto); // ORIENTATION
+    mainWindow.showExpanded();
 
-#ifdef Q_OS_SYMBIAN
-    mainWindow.showFullScreen();
-#elif defined(Q_WS_MAEMO_5)
-    mainWindow.showMaximized();
-#else
-    mainWindow.show();
-#endif
     return app.exec();
 }
index 0ea8b51..a7aa0ba 100644 (file)
@@ -65,3 +65,14 @@ void MainWindow::setOrientation(ScreenOrientation orientation)
     Q_UNUSED(orientation);
 #endif // Q_OS_SYMBIAN
 }
+
+void MainWindow::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+    showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+    showMaximized();
+#else
+    show();
+#endif
+}
index 7080a66..71b20fd 100644 (file)
@@ -29,6 +29,7 @@ public:
     virtual ~MainWindow();
 
     void setOrientation(ScreenOrientation orientation);
+    void showExpanded();
 
 private:
     Ui::MainWindow *ui;
index 8c7755c..03b9820 100644 (file)
@@ -123,13 +123,13 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
 #endif // Q_OS_SYMBIAN
 }
 
-void QmlApplicationViewer::show()
+void QmlApplicationViewer::showExpanded()
 {
 #ifdef Q_OS_SYMBIAN
     showFullScreen();
 #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
     showMaximized();
 #else
-    QDeclarativeView::show();
+    show();
 #endif
 }
index 3f11aee..a317428 100644 (file)
@@ -29,7 +29,7 @@ public:
     void setMainQmlFile(const QString &file);
     void addImportPath(const QString &path);
     void setOrientation(ScreenOrientation orientation);
-    void show();
+    void showExpanded();
 
 private:
     class QmlApplicationViewerPrivate *m_d;