From 147ed4bae8c2ae7395583d916fa6ac9e9803d02c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@digia.com> Date: Mon, 19 May 2014 18:57:34 +0200 Subject: [PATCH] PropertyEditor.QmlDesigner: Fix the color LineEdit Using hasToConvertColor to handle the alpha channel. Change-Id: I6b6e2ef4361efb7aba3adaf549cbddd625145e33 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> --- .../propertyEditorQmlSources/HelperWidgets/ColorEditor.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml index 733f5454dba..e2b9ad9a8f2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml @@ -68,7 +68,6 @@ Column { onColorChanged: { if (!gradientLine.isCompleted) return; - textField.text = gradientLine.colorToString(color); if (supportGradient && gradientLine.visible) gradientLine.currentColor = color @@ -132,6 +131,8 @@ Column { LineEdit { id: textField + hasToConvertColor: true + validator: RegExpValidator { regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g } @@ -141,8 +142,9 @@ Column { backendValue: colorEditor.backendendValue onAccepted: { - colorEditor.color = textField.text + colorEditor.color = colorFromString(textField.text) } + Layout.fillWidth: true } ColorCheckButton { -- GitLab