From fdcde738e585ea0e9912215901e36590ebba7fdf Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 22 Oct 2012 13:44:21 +0200 Subject: Examples and fixes for QML Window properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tools/qmlscene/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools') 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); -- cgit v1.2.3