diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/draganddrop/fridgemagnets/main.cpp | 6 | ||||
-rw-r--r-- | examples/script/context2d/main.cpp | 6 | ||||
-rw-r--r-- | examples/widgets/wiggly/main.cpp | 15 |
3 files changed, 9 insertions, 18 deletions
diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp index e8e0c8d..4a81696 100644 --- a/examples/draganddrop/fridgemagnets/main.cpp +++ b/examples/draganddrop/fridgemagnets/main.cpp @@ -44,16 +44,14 @@ int main(int argc, char *argv[]) { Q_INIT_RESOURCE(fridgemagnets); - bool smallScreen = false; - for (int i=0; i<argc; i++) - if (QString(argv[i]) == "-small-screen") - smallScreen = true; QApplication app(argc, argv); #ifdef QT_KEYPAD_NAVIGATION QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); #endif DragWidget window; + + bool smallScreen = QApplication::arguments().contains("-small-screen"); if (smallScreen) window.showFullScreen(); else diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp index d9ae4e7..1c5b8ac 100644 --- a/examples/script/context2d/main.cpp +++ b/examples/script/context2d/main.cpp @@ -45,14 +45,10 @@ int main(int argc, char **argv) { Q_INIT_RESOURCE(context2d); - bool smallScreen = false; - for (int i = 0; i < argc; i++) - if (QString(argv[i]) == "-small-screen") - smallScreen = true; - QApplication app(argc, argv); Window win; + bool smallScreen = QApplication::arguments().contains("-small-screen"); if (!smallScreen) { win.show(); } else { diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp index 163c231..b8b523f 100644 --- a/examples/widgets/wiggly/main.cpp +++ b/examples/widgets/wiggly/main.cpp @@ -45,16 +45,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - bool smallScreen = false; - for (int i=0; i<argc; i++) - if (QString(argv[i]) == "-small-screen") - smallScreen = true; - Dialog dialog(0,smallScreen); - if (!smallScreen){ + bool smallScreen = QApplication::arguments().contains("-small-screen"); + + Dialog dialog(0, smallScreen); + + if (!smallScreen) dialog.show(); - } - else{ + else dialog.showFullScreen(); - } return app.exec(); } |