diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-03-25 12:36:16 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-05-04 13:47:50 (GMT) |
commit | 35faeb205843c4f0b921d2b878d2d24962c64664 (patch) | |
tree | bd672bf81c38d7b0c6d07b669d62124118a3aab6 /src/declarative/util | |
parent | 9fa0a9319ee0f178d03f9bdc4afbabb8563b4c62 (diff) | |
download | Qt-35faeb205843c4f0b921d2b878d2d24962c64664.zip Qt-35faeb205843c4f0b921d2b878d2d24962c64664.tar.gz Qt-35faeb205843c4f0b921d2b878d2d24962c64664.tar.bz2 |
Moved the QML Observer Service and related functionality into Qt
This code was previously developed as part of Qt Creator in
share/qtcreator/qml/qmljsdebugger/
Moving it into Qt will allow us to simplify the setup required before
you can debug QML applications.
To avoid adding too much weight to the QtDeclarative module, a
declarativeobserver plugin was introduced that contains the
QDeclarativeViewObserver and related classes. The
QDeclarativeObserverService is just a stub service that loads this
plugin once a QML debugging client connects. The plugin implements the
QDeclarativeObserverInterface
A QJSDebugService was separated out of QJSDebuggerAgent, so
that the service can be active while the agent is instantiated lazily.
Each QDeclarativeEngine adds itself to the QJSDebugService. Currently
only the first one is used when instantiating the agent.
QDeclarativeObserverService is hooked into QDeclarativeView, with the
view registering itself to the service, allowing the
QDeclarativeViewObserver to be created for the view once somebody
connects to the service. Again, only the first view is used at the
moment.
Change-Id: Ib50579c6d24361c2b39528e5556410d3446c2e90
Reviewed-by: Martin Jones
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index e24f80f..628c82c 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -49,6 +49,7 @@ #include <qdeclarativeguard_p.h> #include <private/qdeclarativedebugtrace_p.h> +#include <private/qdeclarativeobserverservice_p.h> #include <qscriptvalueiterator.h> #include <qdebug.h> @@ -299,6 +300,8 @@ void QDeclarativeViewPrivate::init() q->viewport()->setAttribute(Qt::WA_OpaquePaintEvent); q->viewport()->setAttribute(Qt::WA_NoSystemBackground); #endif + + QDeclarativeObserverService::instance()->addView(q); } /*! @@ -306,6 +309,7 @@ void QDeclarativeViewPrivate::init() */ QDeclarativeView::~QDeclarativeView() { + QDeclarativeObserverService::instance()->removeView(this); } /*! \property QDeclarativeView::source @@ -558,7 +562,6 @@ void QDeclarativeView::continueExecute() emit statusChanged(status()); } - /*! \internal */ |