diff options
-rw-r--r-- | demos/qtdemo/menumanager.cpp | 8 | ||||
-rw-r--r-- | demos/qtdemo/menumanager.h | 2 | ||||
-rw-r--r-- | demos/qtdemo/qmlShell.qml | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 2 |
4 files changed, 11 insertions, 3 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; }} } diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index bc7468f..cedf9d5 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -551,7 +551,7 @@ QDeclarativeEngine::~QDeclarativeEngine() } /*! \fn void QDeclarativeEngine::quit() - This signal is emitted when the QDeclarativeEngine quits. + This signal is emitted when the QML loaded by the engine would like to quit. */ /*! \fn void QDeclarativeEngine::warnings(const QList<QDeclarativeError> &warnings) |