summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer/main.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-27 04:57:57 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-27 04:57:57 (GMT)
commitb5b6861dd1a82ea9be9b2d2f89ba5cc9dea150ac (patch)
tree2c83046b9c45ffae8e7231c5d753913e6ed0e3e8 /tools/qmlviewer/main.cpp
parent377c3cc4ff74097d173b8518430f36689fbd3331 (diff)
downloadQt-b5b6861dd1a82ea9be9b2d2f89ba5cc9dea150ac.zip
Qt-b5b6861dd1a82ea9be9b2d2f89ba5cc9dea150ac.tar.gz
Qt-b5b6861dd1a82ea9be9b2d2f89ba5cc9dea150ac.tar.bz2
Add -stayontop option.
Diffstat (limited to 'tools/qmlviewer/main.cpp')
-rw-r--r--tools/qmlviewer/main.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp
index f82867f..3f531e4 100644
--- a/tools/qmlviewer/main.cpp
+++ b/tools/qmlviewer/main.cpp
@@ -28,6 +28,7 @@ void usage()
qWarning(" -frameless ............................... run with no window frame");
qWarning(" -maximized................................ run maximized");
qWarning(" -fullscreen............................... run fullscreen");
+ qWarning(" -stayontop................................ keep viewer window on top");
qWarning(" -skin <qvfbskindir> ...................... run with a skin window frame");
qWarning(" \"list\" for a list of built-ins");
qWarning(" -resizeview .............................. resize the view, not the skin");
@@ -105,6 +106,7 @@ int main(int argc, char ** argv)
QString translationFile;
bool useGL = false;
bool fullScreen = false;
+ bool stayOnTop = false;
bool maximized = false;
for (int i = 1; i < argc; ++i) {
@@ -116,6 +118,8 @@ int main(int argc, char ** argv)
maximized = true;
} else if (arg == "-fullscreen") {
fullScreen = true;
+ } else if (arg == "-stayontop") {
+ stayOnTop = true;
} else if (arg == "-skin") {
if (lastArg) usage();
skin = QString(argv[++i]);
@@ -183,9 +187,12 @@ int main(int argc, char ** argv)
app.installTranslator(&qmlTranslator);
}
- QmlViewer viewer(0, frameless ? Qt::FramelessWindowHint : Qt::Widget);
+ Qt::WFlags wflags = (frameless ? Qt::FramelessWindowHint : Qt::Widget);
+ if (stayOnTop)
+ wflags |= Qt::WindowStaysOnTopHint;
+
+ QmlViewer viewer(0, wflags);
if (!scriptopts.isEmpty()) {
-
QStringList options =
scriptopts.split(QLatin1Char(','), QString::SkipEmptyParts);