aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldebug
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-02-05 14:15:47 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-20 16:46:04 +0000
commit895a511245ae3750ac41b352cdc6915c8f8dd110 (patch)
treed71abb637b89516f61ee7d2613401ae4ccc7a69f /src/qmldebug
parent1b6792d3040e013acfa9fa5e39418d5b6a648f4b (diff)
QQmlDebugClient: Make stateChanged a signal
This way we can observe it from the outside and drop all the code that genrated extra signals from the virtual method. Also drop the unused QQmlDebugTestService::stateHasChanged signal to reduce the confusion. Change-Id: Ia37c1eaf8b392e594b0931694f43f84fe09b000c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qmldebug')
-rw-r--r--src/qmldebug/qqmldebugclient.cpp5
-rw-r--r--src/qmldebug/qqmldebugclient_p.h5
-rw-r--r--src/qmldebug/qqmldebugconnection.cpp4
-rw-r--r--src/qmldebug/qqmldebugmessageclient.cpp5
-rw-r--r--src/qmldebug/qqmldebugmessageclient_p.h5
-rw-r--r--src/qmldebug/qqmlprofilerclient.cpp3
-rw-r--r--src/qmldebug/qqmlprofilerclient_p.h2
7 files changed, 8 insertions, 21 deletions
diff --git a/src/qmldebug/qqmldebugclient.cpp b/src/qmldebug/qqmldebugclient.cpp
index d412b7b267..03123cc6e0 100644
--- a/src/qmldebug/qqmldebugclient.cpp
+++ b/src/qmldebug/qqmldebugclient.cpp
@@ -117,11 +117,6 @@ QQmlDebugConnection *QQmlDebugClient::connection() const
return d->connection;
}
-void QQmlDebugClient::stateChanged(QQmlDebugClient::State state)
-{
- Q_UNUSED(state);
-}
-
void QQmlDebugClient::messageReceived(const QByteArray &message)
{
Q_UNUSED(message);
diff --git a/src/qmldebug/qqmldebugclient_p.h b/src/qmldebug/qqmldebugclient_p.h
index 723de5ee43..469b65d4a9 100644
--- a/src/qmldebug/qqmldebugclient_p.h
+++ b/src/qmldebug/qqmldebugclient_p.h
@@ -76,13 +76,14 @@ public:
QQmlDebugConnection *connection() const;
+signals:
+ void stateChanged(State state);
+
protected:
QQmlDebugClient(QQmlDebugClientPrivate &dd);
private:
friend class QQmlDebugConnection;
-
- virtual void stateChanged(State state);
virtual void messageReceived(const QByteArray &message);
};
diff --git a/src/qmldebug/qqmldebugconnection.cpp b/src/qmldebug/qqmldebugconnection.cpp
index 67bad8d812..4e087ee6db 100644
--- a/src/qmldebug/qqmldebugconnection.cpp
+++ b/src/qmldebug/qqmldebugconnection.cpp
@@ -259,7 +259,7 @@ QQmlDebugConnection::~QQmlDebugConnection()
Q_D(QQmlDebugConnection);
QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter)
- iter.value()->stateChanged(QQmlDebugClient::NotConnected);
+ emit iter.value()->stateChanged(QQmlDebugClient::NotConnected);
}
int QQmlDebugConnection::currentDataStreamVersion() const
@@ -295,7 +295,7 @@ void QQmlDebugConnection::close()
QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter)
- iter.value()->stateChanged(QQmlDebugClient::NotConnected);
+ emit iter.value()->stateChanged(QQmlDebugClient::NotConnected);
}
if (d->device) {
diff --git a/src/qmldebug/qqmldebugmessageclient.cpp b/src/qmldebug/qqmldebugmessageclient.cpp
index a03c1f8af2..0892404194 100644
--- a/src/qmldebug/qqmldebugmessageclient.cpp
+++ b/src/qmldebug/qqmldebugmessageclient.cpp
@@ -58,11 +58,6 @@ QQmlDebugMessageClient::QQmlDebugMessageClient(QQmlDebugConnection *client)
{
}
-void QQmlDebugMessageClient::stateChanged(State state)
-{
- emit newState(state);
-}
-
void QQmlDebugMessageClient::messageReceived(const QByteArray &data)
{
QDataStream ds(data);
diff --git a/src/qmldebug/qqmldebugmessageclient_p.h b/src/qmldebug/qqmldebugmessageclient_p.h
index 75c70044e4..a2a7f28f81 100644
--- a/src/qmldebug/qqmldebugmessageclient_p.h
+++ b/src/qmldebug/qqmldebugmessageclient_p.h
@@ -71,15 +71,10 @@ class QQmlDebugMessageClient : public QQmlDebugClient
public:
explicit QQmlDebugMessageClient(QQmlDebugConnection *client);
- virtual void stateChanged(State state) override;
virtual void messageReceived(const QByteArray &) override;
signals:
- void newState(QQmlDebugClient::State);
void message(QtMsgType, const QString &, const QQmlDebugContextInfo &);
-
-private:
- Q_DISABLE_COPY(QQmlDebugMessageClient)
};
QT_END_NAMESPACE
diff --git a/src/qmldebug/qqmlprofilerclient.cpp b/src/qmldebug/qqmlprofilerclient.cpp
index 356190f2b0..0f3cbb49ee 100644
--- a/src/qmldebug/qqmlprofilerclient.cpp
+++ b/src/qmldebug/qqmlprofilerclient.cpp
@@ -170,6 +170,7 @@ QQmlProfilerClient::QQmlProfilerClient(QQmlDebugConnection *connection,
{
Q_D(QQmlProfilerClient);
setRequestedFeatures(features);
+ connect(this, &QQmlDebugClient::stateChanged, this, &QQmlProfilerClient::onStateChanged);
connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeAdded,
this, &QQmlProfilerClient::sendRecordingStatus);
connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeRemoved,
@@ -319,7 +320,7 @@ bool QQmlProfilerClientPrivate::updateFeatures(ProfileFeature feature)
return true;
}
-void QQmlProfilerClient::stateChanged(State status)
+void QQmlProfilerClient::onStateChanged(State status)
{
if (status == Enabled) {
sendRecordingStatus(-1);
diff --git a/src/qmldebug/qqmlprofilerclient_p.h b/src/qmldebug/qqmlprofilerclient_p.h
index 68a32a1a5a..0c867525d2 100644
--- a/src/qmldebug/qqmlprofilerclient_p.h
+++ b/src/qmldebug/qqmlprofilerclient_p.h
@@ -76,7 +76,6 @@ public:
void setRecording(bool);
quint64 recordedFeatures() const;
virtual void messageReceived(const QByteArray &) override;
- virtual void stateChanged(State status) override;
void clearEvents();
void clearAll();
@@ -87,6 +86,7 @@ public:
protected:
QQmlProfilerClient(QQmlProfilerClientPrivate &dd);
+ void onStateChanged(State status);
signals:
void complete(qint64 maximumTime);