diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-30 20:05:43 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-12-15 17:53:25 +0000 |
commit | 57f7fe3e1c92d11bb9e3bf2c87a11e4bc740e255 (patch) | |
tree | 1ea2225a00b8d591c58e59a5f530af3bcb55c8d7 /src/qml/qml/qqmlapplicationengine.cpp | |
parent | 63dede74a386012f9bd5a6896c3fd6ef6ffa01cd (diff) |
Support debugging and profiling for pure QJSEngines
The engines will register themselves with the debug server whenever
they are created without a private object. The assumption is that we
get the latest possible registration like this. They try to deregister
in all dtors, but they check if a different engine has done the same
first.
Change-Id: Ife7d7532d1de2e4a6ee21d9f7e673fcdfff2387b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index b2bf1939b0..4ab35e69e3 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -197,6 +197,7 @@ QQmlApplicationEngine::QQmlApplicationEngine(QObject *parent) { Q_D(QQmlApplicationEngine); d->init(); + QJSEnginePrivate::addToDebugServer(this); } /*! @@ -208,6 +209,7 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QUrl &url, QObject *parent) { Q_D(QQmlApplicationEngine); d->init(); + QJSEnginePrivate::addToDebugServer(this); load(url); } @@ -224,6 +226,7 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *p { Q_D(QQmlApplicationEngine); d->init(); + QJSEnginePrivate::addToDebugServer(this); load(QUrl::fromLocalFile(filePath)); } @@ -233,6 +236,7 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *p QQmlApplicationEngine::~QQmlApplicationEngine() { Q_D(QQmlApplicationEngine); + QJSEnginePrivate::removeFromDebugServer(this); d->cleanUp();//Instantiated root objects must be deleted before the engine } |