diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-02-05 10:07:50 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-04-16 16:49:29 +0200 |
commit | fdedcb6ec650236bef4a8c8f005b5dd24ef7d77a (patch) | |
tree | 430f0e1dc295f0c0a03008db9ef426c192f391ba /src/corelib/kernel/qproperty.h | |
parent | bb44c18b673e2955592ee86774eb7cc25d390c17 (diff) |
Add support for grouped property changes
Add Qt::begin/endPropertyUpdateGroup() methods.
These methods will group a set of property updates together and delay
bindings evaluations or change notifications until the end of the update
group.
In cases where many properties get updated, this can avoid duplicated
recalculations and change notifications.
Change-Id: Ia78ae1d46abc6b7e5da5023442e081cb5c5ae67b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r-- | src/corelib/kernel/qproperty.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 1c557fbace..a6cb7ada48 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -63,6 +63,11 @@ QT_BEGIN_NAMESPACE +namespace Qt { +Q_CORE_EXPORT void beginPropertyUpdateGroup(); +Q_CORE_EXPORT void endPropertyUpdateGroup(); +} + template <typename T> class QPropertyData : public QUntypedPropertyData { @@ -217,6 +222,7 @@ protected: using ChangeHandler = void (*)(QPropertyObserver*, QUntypedPropertyData *); private: + friend struct QPropertyDelayedNotifications; friend struct QPropertyObserverNodeProtector; friend class QPropertyObserver; friend struct QPropertyObserverPointer; |