diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2021-05-10 15:28:52 +0200 |
---|---|---|
committer | Arno Rehn <a.rehn@menlosystems.com> | 2021-05-20 13:38:10 +0000 |
commit | f8ee2550f7d8f65954facb919bf45bfcf2bb4c3d (patch) | |
tree | 21fae844ba2f90f040ee45b13a158658673418b2 /src/webchannel/qmetaobjectpublisher_p.h | |
parent | a7199de7d90f48ce3d95cae795bd9209c39516ce (diff) |
Make blockUpdates bindable
[ChangeLog] Make blockUpdates bindable
Task-number: QTBUG-93601
Change-Id: I7a5e06ecb3258b11988343321b78ffaab1d48dc0
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Diffstat (limited to 'src/webchannel/qmetaobjectpublisher_p.h')
-rw-r--r-- | src/webchannel/qmetaobjectpublisher_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h index 60a855f..a84eb52 100644 --- a/src/webchannel/qmetaobjectpublisher_p.h +++ b/src/webchannel/qmetaobjectpublisher_p.h @@ -320,6 +320,7 @@ public: * When updates are blocked, no property updates are transmitted to remote clients. */ void setBlockUpdates(bool block); + bool blockUpdates() const; Q_SIGNALS: void blockUpdatesChanged(bool block); @@ -334,6 +335,8 @@ protected: void timerEvent(QTimerEvent *) override; private: + void onBlockUpdatesChanged(); + friend class QQmlWebChannelPrivate; friend class QWebChannel; friend class TestWebChannel; @@ -353,8 +356,9 @@ private: QHash<QWebChannelAbstractTransport *, TransportState> transportState; // true when no property updates should be sent, false otherwise - bool blockUpdates; + Q_OBJECT_BINDABLE_PROPERTY(QMetaObjectPublisher, bool, blockUpdatesStatus); + QPropertyChangeHandler<std::function<void()>> blockUpdatesHandler; // true when at least one client was initialized and thus // the property updates have been initialized and the // object info map set. |