summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/deform/main.cpp5
-rw-r--r--demos/pathstroke/main.cpp5
-rw-r--r--examples/draganddrop/fridgemagnets/main.cpp6
-rw-r--r--examples/script/context2d/main.cpp6
-rw-r--r--examples/widgets/wiggly/main.cpp15
5 files changed, 11 insertions, 26 deletions
diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp
index 4539973..bef075a 100644
--- a/demos/deform/main.cpp
+++ b/demos/deform/main.cpp
@@ -50,10 +50,7 @@ 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;
+ bool smallScreen = QApplication::arguments().contains("-small-screen");
PathDeformWidget deformWidget(0, smallScreen);
diff --git a/demos/pathstroke/main.cpp b/demos/pathstroke/main.cpp
index 1465682..534b233 100644
--- a/demos/pathstroke/main.cpp
+++ b/demos/pathstroke/main.cpp
@@ -48,10 +48,7 @@ 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;
+ bool smallScreen = QApplication::arguments().contains("-small-screen");
PathStrokeWidget pathStrokeWidget(smallScreen);
QStyle *arthurStyle = new ArthurStyle();
diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp
index 3c517bd..b5a39c0 100644
--- a/examples/draganddrop/fridgemagnets/main.cpp
+++ b/examples/draganddrop/fridgemagnets/main.cpp
@@ -45,16 +45,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 95daf2b..8fd68db 100644
--- a/examples/script/context2d/main.cpp
+++ b/examples/script/context2d/main.cpp
@@ -46,14 +46,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 4a6cd5d..8ad7696 100644
--- a/examples/widgets/wiggly/main.cpp
+++ b/examples/widgets/wiggly/main.cpp
@@ -46,16 +46,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();
}