diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-11-01 19:19:32 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-11-01 19:19:32 +0100 |
commit | 2a7336b4d661466f31ee487b95ec44d54df88792 (patch) | |
tree | f4507c5c43b7f8b82ca36a5939012b2242ad9b3e /share | |
parent | 7d622f11453c0226f8cf22760c4972c7156baf09 (diff) | |
download | qt-creator-2a7336b4d661466f31ee487b95ec44d54df88792.tar.gz |
Move hide implementation of conditional show()
...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
Diffstat (limited to 'share')
5 files changed, 16 insertions, 10 deletions
diff --git a/share/qtcreator/templates/mobileapp/main.cpp b/share/qtcreator/templates/mobileapp/main.cpp index 355b1b1feb..0ba2a15ae5 100644 --- a/share/qtcreator/templates/mobileapp/main.cpp +++ b/share/qtcreator/templates/mobileapp/main.cpp @@ -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(); } diff --git a/share/qtcreator/templates/mobileapp/mainwindow.cpp b/share/qtcreator/templates/mobileapp/mainwindow.cpp index 0ea8b51ca6..a7aa0badef 100644 --- a/share/qtcreator/templates/mobileapp/mainwindow.cpp +++ b/share/qtcreator/templates/mobileapp/mainwindow.cpp @@ -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 +} diff --git a/share/qtcreator/templates/mobileapp/mainwindow.h b/share/qtcreator/templates/mobileapp/mainwindow.h index 7080a666ef..71b20fda37 100644 --- a/share/qtcreator/templates/mobileapp/mainwindow.h +++ b/share/qtcreator/templates/mobileapp/mainwindow.h @@ -29,6 +29,7 @@ public: virtual ~MainWindow(); void setOrientation(ScreenOrientation orientation); + void showExpanded(); private: Ui::MainWindow *ui; diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp index 8c7755c39a..03b9820fa4 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -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 } diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.h b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.h index 3f11aee3ba..a3174282f9 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.h +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.h @@ -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; |