aboutsummaryrefslogtreecommitdiffstats
path: root/examples/shared
diff options
context:
space:
mode:
authorJan Kundrát <jkt@flaska.net>2012-10-16 20:33:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-17 08:50:52 +0200
commit62e8934fe3879665d14092543ad06bb17ce9071f (patch)
tree570ba5ebe8aa8f837956a2611c003717c68e9d2b /examples/shared
parentb495a61c6b0c79d20d98428a34750ad30839e7e4 (diff)
Make Qt.quit() from inside QML work in the examples
Without this patch, the samegame's quit button does not work. Change-Id: I904832d018d589e90564534ac1eca02e0dbb54fc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'examples/shared')
-rw-r--r--examples/shared/shared.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/shared/shared.h b/examples/shared/shared.h
index 0e9395a108..bf3857f896 100644
--- a/examples/shared/shared.h
+++ b/examples/shared/shared.h
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QDir>
#include <QGuiApplication>
+#include <QQmlEngine>
#include <QQuickView>
#define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \
{\
@@ -68,6 +69,7 @@
qWarning("Could not find file '%s'", qPrintable(QDir::toNativeSeparators(fileName)));\
return -1;\
}\
+ view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
view.setSource(QUrl::fromLocalFile(fileName));\
view.show();\
return app.exec();\