Skip to content
Snippets Groups Projects
Commit 2a7336b4 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

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
parent 7d622f11
No related branches found
No related tags found
No related merge requests found
...@@ -8,13 +8,7 @@ int main(int argc, char *argv[]) ...@@ -8,13 +8,7 @@ int main(int argc, char *argv[])
MainWindow mainWindow; MainWindow mainWindow;
mainWindow.setOrientation(MainWindow::ScreenOrientationAuto); // ORIENTATION 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(); return app.exec();
} }
...@@ -65,3 +65,14 @@ void MainWindow::setOrientation(ScreenOrientation orientation) ...@@ -65,3 +65,14 @@ void MainWindow::setOrientation(ScreenOrientation orientation)
Q_UNUSED(orientation); Q_UNUSED(orientation);
#endif // Q_OS_SYMBIAN #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
}
...@@ -29,6 +29,7 @@ public: ...@@ -29,6 +29,7 @@ public:
virtual ~MainWindow(); virtual ~MainWindow();
void setOrientation(ScreenOrientation orientation); void setOrientation(ScreenOrientation orientation);
void showExpanded();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
......
...@@ -123,13 +123,13 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) ...@@ -123,13 +123,13 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
#endif // Q_OS_SYMBIAN #endif // Q_OS_SYMBIAN
} }
void QmlApplicationViewer::show() void QmlApplicationViewer::showExpanded()
{ {
#ifdef Q_OS_SYMBIAN #ifdef Q_OS_SYMBIAN
showFullScreen(); showFullScreen();
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
showMaximized(); showMaximized();
#else #else
QDeclarativeView::show(); show();
#endif #endif
} }
...@@ -29,7 +29,7 @@ public: ...@@ -29,7 +29,7 @@ public:
void setMainQmlFile(const QString &file); void setMainQmlFile(const QString &file);
void addImportPath(const QString &path); void addImportPath(const QString &path);
void setOrientation(ScreenOrientation orientation); void setOrientation(ScreenOrientation orientation);
void show(); void showExpanded();
private: private:
class QmlApplicationViewerPrivate *m_d; class QmlApplicationViewerPrivate *m_d;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment