diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-06-13 17:28:00 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-19 15:32:14 +0200 |
commit | 8f65a4440c0078f82f311b56200aec081a6fdd85 (patch) | |
tree | f12c1a634a8ca9f9a876125a4583532c1618e741 /tools/qmlscene | |
parent | 6b05247d1e353b7b540fc16c29df129bf636e368 (diff) |
qmlscene: add --transparent argument
The option makes qmlscene request a format with alpha for the QQuickView.
Change-Id: I6490e606dd0af534147de95783f3a2ddfa8c52c8
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'tools/qmlscene')
-rw-r--r-- | tools/qmlscene/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 06b3c378dc..54713fc976 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -144,6 +144,7 @@ struct Options , originalQmlRaster(false) , maximized(false) , fullscreen(false) + , transparent(false) , clip(false) , versionDetection(true) , slowAnimations(false) @@ -157,6 +158,7 @@ struct Options bool originalQmlRaster; bool maximized; bool fullscreen; + bool transparent; bool scenegraphOnGraphicsview; bool clip; bool versionDetection; @@ -336,6 +338,7 @@ static void usage() qWarning(" options:"); qWarning(" --maximized ............................... run maximized"); qWarning(" --fullscreen .............................. run fullscreen"); + qWarning(" --transparent ............................. Make the window transparent"); qWarning(" --no-multisample .......................... Disable multisampling (anti-aliasing)"); qWarning(" --no-version-detection .................... Do not try to detect the version of the .qml file"); qWarning(" --slow-animations ......................... Run all animations in slow motion"); @@ -363,6 +366,8 @@ int main(int argc, char ** argv) options.maximized = true; else if (lowerArgument == QLatin1String("--fullscreen")) options.fullscreen = true; + else if (lowerArgument == QLatin1String("--transparent")) + options.transparent = true; else if (lowerArgument == QLatin1String("--clip")) options.clip = true; else if (lowerArgument == QLatin1String("--no-version-detection")) @@ -432,6 +437,15 @@ int main(int argc, char ** argv) else qxView->setResizeMode(QQuickView::SizeRootObjectToView); + if (options.transparent) { + QSurfaceFormat surfaceFormat; + surfaceFormat.setAlphaBufferSize(8); + qxView->setFormat(surfaceFormat); + qxView->setClearBeforeRendering(true); + qxView->setClearColor(QColor(Qt::transparent)); + qxView->setWindowFlags(Qt::FramelessWindowHint); + } + window->setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); if (options.fullscreen) window->showFullScreen(); |