forked from qt-creator/qt-creator
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user