summaryrefslogtreecommitdiffstats
path: root/demos/qtdemo/menumanager.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-08-20 05:18:43 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-08-20 05:18:43 (GMT)
commitdb63beeb4d421e98d851f4f837ad978e0f04d9aa (patch)
treed23f5ab6d54cc12d04f91d7f2f4721934e2b05ac /demos/qtdemo/menumanager.cpp
parenta48c48f6b37c70416c4fad8ff8fa87467c540b78 (diff)
downloadQt-db63beeb4d421e98d851f4f837ad978e0f04d9aa.zip
Qt-db63beeb4d421e98d851f4f837ad978e0f04d9aa.tar.gz
Qt-db63beeb4d421e98d851f4f837ad978e0f04d9aa.tar.bz2
Allow QML Quit buttons to work inside QtDemo.
Also changes the line documenting the quit signal on QDeclarativeEngine.
Diffstat (limited to 'demos/qtdemo/menumanager.cpp')
-rw-r--r--demos/qtdemo/menumanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index f98c2fc..4ae9ca1 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -390,6 +390,12 @@ void MenuManager::launchQmlExample(const QString &name)
#endif
}
+void MenuManager::quitQML()
+{
+ if(qmlRoot)
+ qmlRoot->setProperty("show", QVariant(false));
+}
+
void MenuManager::exampleFinished()
{
}
@@ -437,6 +443,8 @@ void MenuManager::init(MainWindow *window)
#ifndef QT_NO_DECLARATIVE
// Create QML Loader
declarativeEngine = new QDeclarativeEngine(this);
+ connect(declarativeEngine, SIGNAL(quit()),
+ this, SLOT(quitQML()));
QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this);
QDeclarativeItem* qmlRootItem = 0;