summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-08 06:26:49 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-08 06:26:49 (GMT)
commit15de11bfcd2907e587dff41013fd39b62f0ca869 (patch)
tree9a22d5d4463ad96182592d338462f0a659fca63c
parent7f8e635a2bcba8635416d73ea7592e944f569741 (diff)
downloadQt-15de11bfcd2907e587dff41013fd39b62f0ca869.zip
Qt-15de11bfcd2907e587dff41013fd39b62f0ca869.tar.gz
Qt-15de11bfcd2907e587dff41013fd39b62f0ca869.tar.bz2
Make sure qmlviewer uses raster graphcis system, or respects what was
input.
-rw-r--r--tools/qmlviewer/main.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp
index 379fda9..9a008d2 100644
--- a/tools/qmlviewer/main.cpp
+++ b/tools/qmlviewer/main.cpp
@@ -47,18 +47,24 @@ int main(int argc, char ** argv)
//### default to using raster graphics backend for now
int newargc = argc + 2;
char **newargv;
- newargv = new char * [newargc];
+ bool gsSpecified = false;
for (int i = 0; i < argc; ++i) {
- newargv[i] = argv[i];
if (!qstrcmp(argv[i], "-graphicssystem")) {
+ gsSpecified = true;
newargc -= 2;
break;
}
}
- char system[] = "-graphicssystem";
- newargv[argc] = system;
- char raster[] = "raster";
- newargv[argc+1] = raster;
+ newargv = new char * [newargc];
+ for (int i = 0; i < argc; ++i) {
+ newargv[i] = argv[i];
+ }
+ if (!gsSpecified) {
+ char system[] = "-graphicssystem";
+ newargv[argc] = system;
+ char raster[] = "raster";
+ newargv[argc+1] = raster;
+ }
QApplication app(newargc, newargv);
app.setApplicationName("viewer");