summaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-03-29 06:57:56 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-04-16 05:26:40 (GMT)
commit8620548e1024c44fbff1cb1becaab8d2d9e53cd5 (patch)
treeb33e880d091aed966e54762ed971a15fd8be360a /tools/qml/main.cpp
parentba3f33401c97c5517abe19f4ea6f6307e4374c6c (diff)
downloadQt-8620548e1024c44fbff1cb1becaab8d2d9e53cd5.zip
Qt-8620548e1024c44fbff1cb1becaab8d2d9e53cd5.tar.gz
Qt-8620548e1024c44fbff1cb1becaab8d2d9e53cd5.tar.bz2
ResizeMode support for QGraphicsWidgets created with QDeclarativeView
Task-number: QTBUG-8814 Reviewed-by: alexis
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r--tools/qml/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 341908e..5e829a4 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -88,6 +88,8 @@ void usage()
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");
+ qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content");
+ qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view");
qWarning(" -qmlbrowser .............................. use a QML-based file browser");
qWarning(" -recordfile <output> ..................... set video recording file");
qWarning(" - ImageMagick 'convert' for GIF)");
@@ -184,6 +186,7 @@ int main(int argc, char ** argv)
bool stayOnTop = false;
bool maximized = false;
bool useNativeFileBrowser = true;
+ bool sizeToView = true;
#if defined(Q_OS_SYMBIAN)
maximized = true;
@@ -270,6 +273,10 @@ int main(int argc, char ** argv)
if (lastArg) usage();
script = QString(argv[++i]);
runScript = true;
+ } else if (arg == "-sizeviewtorootobject") {
+ sizeToView = false;
+ } else if (arg == "-sizerootobjecttoview") {
+ sizeToView = true;
} else if (arg[0] != '-') {
fileName = arg;
} else if (1 || arg == "-help") {
@@ -339,6 +346,7 @@ int main(int argc, char ** argv)
viewer.setNetworkCacheSize(cache);
viewer.setRecordFile(recordfile);
+ viewer.setSizeToView(sizeToView);
if (resizeview)
viewer.setScaleView();
if (fps>0)
@@ -390,6 +398,5 @@ int main(int argc, char ** argv)
}
viewer.setUseGL(useGL);
viewer.raise();
-
return app.exec();
}