Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
-
6bc11283ea23f8e4b06fa8e0e49b8e9e0b9e35bb
Description
Our current generated main.cpp looks like:
#include <QtGui/QApplication> #include "qmlapplicationviewer.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::Auto); viewer.setMainQmlFile(QLatin1String("qml/helloworld3/helloworld3.qml")); #ifdef Q_OS_SYMBIAN viewer.showFullScreen(); #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) viewer.showMaximized(); #else viewer.show(); #endif return app.exec(); }
Can we get rid of the #ifdefs by overloading QmlApplicationViewer::show()? Ideally the 'default' behavior of show should be IMO system specific. If there's actual need ::show() could also take an optional enum, e.g.:
enum WindowSize
{ WindowDefaultSize, WindowMaximizeSize, WindowFullScreenSize, WindowSystemDefaultSize};
void QmlApplicationViewer::show(WindowSize windowSize = WindowSystemDefaultSize) {
//....
}