QmlDesigner.PropertyEditor: Fixing color conversion in LineEdit

For color properties we have to take care of the alpha channel
manually.

Change-Id: I2cbb5a2c45a16385068e771e1a1ca8a10f47a7bf
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Thomas Hartmann
2014-05-19 16:32:07 +02:00
parent 44060c150e
commit de67cb25e0

View File

@@ -47,6 +47,8 @@ Controls.TextField {
property bool showTranslateCheckBox: true
property bool hasToConvertColor: false
ExtendedFunctionButton {
x: 2
y: 4
@@ -58,11 +60,19 @@ Controls.TextField {
id: colorLogic
backendValue: lineEdit.backendValue
onValueFromBackendChanged: {
lineEdit.text = valueFromBackend;
if (hasToConvertColor) {
lineEdit.text = convertColorToString(valueFromBackend)
} else {
lineEdit.text = valueFromBackend
}
}
}
onEditingFinished: {
if (hasToConvertColor)
return
if (backendValue.isTranslated) {
backendValue.expression = "qsTr(\"" + trCheckbox.escapeString(text) + "\")"
} else {