From 286f14f1e29e7f4e2db4517d087dd5c92606f971 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 5 Jul 2017 12:53:01 +0200 Subject: Add QQuickItem::ItemEnabledHasChanged The itemChange() method has been very useful for Qt Quick Controls 2 to efficiently react to various item changes, but a notification for the enabled state was missing, so it always had to be handled as a special case using signals and slots. This change allows QQC2 to handle enabled state changes the same way e.g. visibility changes are handled. It's also nice to be able to update a control's internal state before the actual notifier signal is emitted. [ChangeLog][QtQuick][QQuickItem] Added a ItemEnabledHasChanged value to the ItemChange enum. QQuickItem::itemChange(ItemEnabledHasChanged) gets called when the item's effective enabled state has changed. The new enabled state is stored in ItemChangeData::boolValue. Change-Id: Iae96ec21f2b94f453632282473decd1c66097a75 Reviewed-by: Mitch Curtis Reviewed-by: Robin Burchell --- src/quick/items/qquickitem.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickitem.h') diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index f58946d01d..4a832bbf6f 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -173,7 +173,8 @@ public: ItemActiveFocusHasChanged, // value.boolValue ItemRotationHasChanged, // value.realValue ItemAntialiasingHasChanged, // value.boolValue - ItemDevicePixelRatioHasChanged // value.realValue + ItemDevicePixelRatioHasChanged, // value.realValue + ItemEnabledHasChanged // value.boolValue }; union ItemChangeData { -- cgit v1.2.3