diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2012-10-22 13:44:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-09 13:33:19 +0100 |
commit | fdcde738e585ea0e9912215901e36590ebba7fdf (patch) | |
tree | 951d7e27b9449cf906368ecf43265cf866f2a1f2 /tools | |
parent | e35c6a788a887d7a85a836041e7d8e9a5ee48c46 (diff) |
Examples and fixes for QML Window properties
Setting Window.color in QML takes effect immediately.
It was only possible to set the property at startup.
Examples demonstrate new Window property features.
Change-Id: Ic5b43d0d84371f3fe5c42223ccc98e6de27aed10
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlscene/main.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 55925a0523..d41ade4a98 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -476,6 +476,9 @@ int main(int argc, char ** argv) if (contentItem) { qxView = new QQuickView(&engine, NULL); window = qxView; + // Set window default properties; the qml can still override them + QString oname = contentItem->objectName(); + window->setTitle(oname.isEmpty() ? QString::fromLatin1("qmlscene") : QString::fromLatin1("qmlscene: ") + oname); window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); if (options.resizeViewToRootItem) qxView->setResizeMode(QQuickView::SizeViewToRootObject); |