diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-08-20 05:18:43 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-08-20 05:18:43 (GMT) |
commit | db63beeb4d421e98d851f4f837ad978e0f04d9aa (patch) | |
tree | d23f5ab6d54cc12d04f91d7f2f4721934e2b05ac /demos/qtdemo | |
parent | a48c48f6b37c70416c4fad8ff8fa87467c540b78 (diff) | |
download | Qt-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')
-rw-r--r-- | demos/qtdemo/menumanager.cpp | 8 | ||||
-rw-r--r-- | demos/qtdemo/menumanager.h | 2 | ||||
-rw-r--r-- | demos/qtdemo/qmlShell.qml | 2 |
3 files changed, 10 insertions, 2 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; diff --git a/demos/qtdemo/menumanager.h b/demos/qtdemo/menumanager.h index e4303c8..93fb998 100644 --- a/demos/qtdemo/menumanager.h +++ b/demos/qtdemo/menumanager.h @@ -95,6 +95,8 @@ private slots: void exampleFinished(); void exampleError(QProcess::ProcessError error); + void quitQML(); + private: // singleton pattern: MenuManager(); diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml index b8a019e..24c12ae 100644 --- a/demos/qtdemo/qmlShell.qml +++ b/demos/qtdemo/qmlShell.qml @@ -68,8 +68,6 @@ Item { loader.item.width = 640; if(loader.item.height > 480) loader.item.height = 480; - if(loader.item.inAnotherDemo != undefined) - loader.item.inAnotherDemo = true; }} } |