PropertyEditor.QmlDesigner: Fix the color LineEdit

Using hasToConvertColor to handle the alpha channel.

Change-Id: I6b6e2ef4361efb7aba3adaf549cbddd625145e33
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Thomas Hartmann
2014-05-19 18:57:34 +02:00
parent 32bc73d684
commit 147ed4bae8

View File

@@ -68,7 +68,6 @@ Column {
onColorChanged: { onColorChanged: {
if (!gradientLine.isCompleted) if (!gradientLine.isCompleted)
return; return;
textField.text = gradientLine.colorToString(color);
if (supportGradient && gradientLine.visible) if (supportGradient && gradientLine.visible)
gradientLine.currentColor = color gradientLine.currentColor = color
@@ -132,6 +131,8 @@ Column {
LineEdit { LineEdit {
id: textField id: textField
hasToConvertColor: true
validator: RegExpValidator { validator: RegExpValidator {
regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g
} }
@@ -141,8 +142,9 @@ Column {
backendValue: colorEditor.backendendValue backendValue: colorEditor.backendendValue
onAccepted: { onAccepted: {
colorEditor.color = textField.text colorEditor.color = colorFromString(textField.text)
} }
Layout.fillWidth: true Layout.fillWidth: true
} }
ColorCheckButton { ColorCheckButton {