diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp index f985c0fc5cf..40855c70ebd 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp @@ -88,6 +88,11 @@ void QmlProfilerTraceClient::clearData() emit cleared(); } +bool QmlProfilerTraceClient::isEnabled() const +{ + return status() == Enabled; +} + bool QmlProfilerTraceClient::isRecording() const { return d->recording; diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h index e2e01b7087d..0bb7270773e 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h @@ -53,6 +53,7 @@ struct QMLJSDEBUGCLIENT_EXPORT Location class QMLJSDEBUGCLIENT_EXPORT QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient { Q_OBJECT + Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabled) Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged) // don't hide by signal @@ -84,6 +85,7 @@ public: MaximumMessage }; + bool isEnabled() const; bool isRecording() const; public slots: diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 57484c023f3..e682aeff056 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -297,7 +297,7 @@ Rectangle { id: elapsedTimer property date startDate property bool reset: true - running: connection.recording + running: connection.recording && connection.enabled repeat: true onRunningChanged: { if (running) reset = true;