From bec91cbad8c12e2c2dffc16611522bf463f2591a Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 26 Nov 2019 11:28:11 +0100 Subject: QmlDesigner: Fix editable ComboBox popup selection This patch introduces a new state called 'popup' to disable text editing while the popup is opened and enables text editing whenever the popup is closed. Task-number: QDS-1262 Change-Id: I74ad4723d2cfe81447e94c37e9ba1f0913790d97 Reviewed-by: Thomas Hartmann --- .../imports/StudioControls/ComboBox.qml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml index 747a0d4510..1c3dc46c15 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml @@ -244,7 +244,7 @@ T.ComboBox { }, State { name: "edit" - when: myComboBox.edit && myComboBox.editable + when: myComboBox.edit && myComboBox.editable && !comboBoxPopup.opened PropertyChanges { target: myComboBox wheelEnabled: true @@ -252,12 +252,29 @@ T.ComboBox { PropertyChanges { target: comboBoxInput selectByMouse: true + readOnly: false } PropertyChanges { target: comboBoxBackground color: StudioTheme.Values.themeInteraction border.color: StudioTheme.Values.themeInteraction } + StateChangeScript { + script: comboBoxPopup.close() + } + }, + State { + name: "popup" + when: myComboBox.edit && comboBoxPopup.opened + PropertyChanges { + target: myComboBox + wheelEnabled: true + } + PropertyChanges { + target: comboBoxInput + selectByMouse: false + readOnly: true + } } ] -- cgit v1.2.1