diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2024-04-04 10:49:03 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-15 03:59:54 +0000 |
commit | 29a68a2267de1d4e2d0bfbeb333b5200475b550d (patch) | |
tree | 9937191471a1d297a47753a781065f92ae2851f1 | |
parent | b52a3c932ffbeea90138ef3240e65974e810b096 (diff) |
Remove native style customization warnings for ItemDelegate
It has no native visuals so customizing it is fine.
Task-number: QTBUG-123773
Pick-to: 6.5
Change-Id: Iebac1231b096dbb5f9cde1d79ccda59688b25f09
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f5b235b95d3518717a58259fd12b06a26ade1fe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
8 files changed, 14 insertions, 9 deletions
diff --git a/src/quickcontrols/macos/CheckDelegate.qml b/src/quickcontrols/macos/CheckDelegate.qml index 4f20703f5d..6c6d8f14c4 100644 --- a/src/quickcontrols/macos/CheckDelegate.qml +++ b/src/quickcontrols/macos/CheckDelegate.qml @@ -24,7 +24,9 @@ T.CheckDelegate { spacing: 6 padding: 6 - contentItem: NativeStyle.DefaultItemDelegateIconLabel {} + contentItem: NativeStyle.DefaultItemDelegateIconLabel { + readonly property bool __ignoreNotCustomizable: true + } indicator: NativeStyle.CheckDelegate { x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 diff --git a/src/quickcontrols/windows/CheckDelegate.qml b/src/quickcontrols/windows/CheckDelegate.qml index 21a52a23ab..ce020161c8 100644 --- a/src/quickcontrols/windows/CheckDelegate.qml +++ b/src/quickcontrols/windows/CheckDelegate.qml @@ -26,6 +26,8 @@ T.CheckDelegate { contentItem: NativeStyle.DefaultItemDelegateIconLabel { color: control.highlighted ? control.palette.button : control.palette.windowText + + readonly property bool __ignoreNotCustomizable: true } indicator: NativeStyle.CheckDelegate { diff --git a/src/quickcontrols/windows/RadioDelegate.qml b/src/quickcontrols/windows/RadioDelegate.qml index 325e86b738..e74e42350b 100644 --- a/src/quickcontrols/windows/RadioDelegate.qml +++ b/src/quickcontrols/windows/RadioDelegate.qml @@ -6,5 +6,7 @@ import QtQuick.NativeStyle as NativeStyle NativeStyle.DefaultRadioDelegate { contentItem: NativeStyle.DefaultItemDelegateIconLabel { color: control.highlighted ? control.palette.button : control.palette.windowText + + readonly property bool __ignoreNotCustomizable: true } } diff --git a/src/quickcontrols/windows/SwitchDelegate.qml b/src/quickcontrols/windows/SwitchDelegate.qml index cf52de2e18..0130a9b372 100644 --- a/src/quickcontrols/windows/SwitchDelegate.qml +++ b/src/quickcontrols/windows/SwitchDelegate.qml @@ -30,6 +30,8 @@ T.SwitchDelegate { contentItem: NativeStyle.DefaultItemDelegateIconLabel { color: control.highlighted ? control.palette.button : control.palette.windowText + + readonly property bool __ignoreNotCustomizable: true } background: Rectangle { diff --git a/src/quicknativestyle/controls/DefaultItemDelegate.qml b/src/quicknativestyle/controls/DefaultItemDelegate.qml index bce6b10da7..55c54dbca5 100644 --- a/src/quicknativestyle/controls/DefaultItemDelegate.qml +++ b/src/quicknativestyle/controls/DefaultItemDelegate.qml @@ -9,8 +9,6 @@ import QtQuick.NativeStyle as NativeStyle T.ItemDelegate { id: control - readonly property bool __notCustomizable: true - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, @@ -30,7 +28,5 @@ T.ItemDelegate { implicitHeight: 20 color: Qt.darker(control.highlighted ? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1) - - readonly property bool __ignoreNotCustomizable: true } } diff --git a/src/quicknativestyle/controls/DefaultItemDelegateIconLabel.qml b/src/quicknativestyle/controls/DefaultItemDelegateIconLabel.qml index af339d6bef..7ac31e9f3e 100644 --- a/src/quicknativestyle/controls/DefaultItemDelegateIconLabel.qml +++ b/src/quicknativestyle/controls/DefaultItemDelegateIconLabel.qml @@ -18,5 +18,4 @@ IconLabel { rightPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 readonly property T.ItemDelegate control: parent as T.ItemDelegate - readonly property bool __ignoreNotCustomizable: true } diff --git a/src/quicknativestyle/controls/DefaultRadioDelegate.qml b/src/quicknativestyle/controls/DefaultRadioDelegate.qml index 0fbac89733..82bc0d26bf 100644 --- a/src/quicknativestyle/controls/DefaultRadioDelegate.qml +++ b/src/quicknativestyle/controls/DefaultRadioDelegate.qml @@ -26,7 +26,9 @@ T.RadioDelegate { icon.width: 16 icon.height: 16 - contentItem: NativeStyle.DefaultItemDelegateIconLabel {} + contentItem: NativeStyle.DefaultItemDelegateIconLabel { + readonly property bool __ignoreNotCustomizable: true + } indicator: NativeStyle.RadioDelegate { x: control.text diff --git a/tests/auto/quickcontrols/customization/tst_customization.cpp b/tests/auto/quickcontrols/customization/tst_customization.cpp index e55df16202..d011f24d6a 100644 --- a/tests/auto/quickcontrols/customization/tst_customization.cpp +++ b/tests/auto/quickcontrols/customization/tst_customization.cpp @@ -366,7 +366,7 @@ void tst_customization::override_data() "macOS", { "Button", "CheckBox", "CheckDelegate", "ComboBox", "DelayButton", "Dial", "Frame", - "GroupBox", "ItemDelegate", "ProgressBar", "RadioButton", "RadioDelegate", "SelectionRectangle", + "GroupBox", "ProgressBar", "RadioButton", "RadioDelegate", "SelectionRectangle", "RangeSlider", "Slider", "SpinBox", "TextArea", "TextField", "TreeViewDelegate" // TODO: ScrollView, ScrollBar } @@ -375,7 +375,7 @@ void tst_customization::override_data() "Windows", { "Button", "CheckBox", "CheckDelegate", "ComboBox", "DelayButton", "Frame", "GroupBox", - "ItemDelegate", "ProgressBar", "RadioButton", "RadioDelegate", "RangeSlider", "SelectionRectangle", + "ProgressBar", "RadioButton", "RadioDelegate", "RangeSlider", "SelectionRectangle", "ScrollBar", "Slider", "SpinBox", "Switch", "SwitchDelegate", "TextArea", "TextField" } } |