diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-13 15:56:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-31 06:44:13 +0000 |
commit | cc3a57861d5ef6e84cef0adfa1aaf726dd2b9d84 (patch) | |
tree | ef5c3983cda85022afd077fe05a2cb850aa0274b /src/qml/debugger/qqmldebugservice_p.h | |
parent | 4d07a6254cac5742ffc23377b97c6eaf04aa4c49 (diff) |
Use signal/slot for passing messages through QQmlDebugServer
This results in much cleaner code than the previous implementation
using QMetaObject::invokeMethod().
We have to use read locks now for adding and removing engines, as we
should have done already before. If a condition is waiting on a write
lock you cannot acquire a read lock from another thread. So, if we kept
the write locks we wouldn't be able to receive messages while the engines
are waiting.
Change-Id: Icfe641601dec2f8d7181ae579146ed603d57a4c2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/debugger/qqmldebugservice_p.h')
-rw-r--r-- | src/qml/debugger/qqmldebugservice_p.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h index e17c02b477..311ce3e355 100644 --- a/src/qml/debugger/qqmldebugservice_p.h +++ b/src/qml/debugger/qqmldebugservice_p.h @@ -81,9 +81,6 @@ public: virtual void engineAdded(QQmlEngine *); virtual void engineRemoved(QQmlEngine *); - void sendMessage(const QByteArray &); - void sendMessages(const QList<QByteArray> &); - static const QHash<int, QObject *> &objectsForIds(); static int idForObject(QObject *); static QObject *objectForId(int id) { return objectsForIds().value(id); } @@ -97,6 +94,9 @@ protected: signals: void attachedToEngine(QQmlEngine *); void detachedFromEngine(QQmlEngine *); + + void messageToClient(const QString &name, const QByteArray &message); + void messagesToClient(const QString &name, const QList<QByteArray> &messages); }; class Q_QML_PRIVATE_EXPORT QQmlDebugStream : public QDataStream |