Commit 150803bc authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.PropertyEditor: Fix echo mode

TextEdit does not have an echoMode property
and for TextField it has to be an integer.

Task-number: QTCREATORBUG-11136
Change-Id: Ib560dd18ed31f9a735fd2c6874334e1479fd3a31
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 5d407760
......@@ -39,14 +39,20 @@ Controls.ComboBox {
property color textColor: colorLogic.textColor
property string scope: "Qt"
property bool useInteger: false
ColorLogic {
id: colorLogic
backendValue: comboBox.backendValue
onValueFromBackendChanged: {
var enumString = comboBox.backendValue.enumeration;
if (enumString === "")
enumString = comboBox.backendValue.value
comboBox.currentIndex = comboBox.find(enumString);
if (!comboBox.useInt) {
var enumString = comboBox.backendValue.enumeration;
if (enumString === "")
enumString = comboBox.backendValue.value
comboBox.currentIndex = comboBox.find(enumString);
} else {
comboBox.currentIndex = backendValue.value
}
}
}
......@@ -54,7 +60,12 @@ Controls.ComboBox {
if (backendValue === undefined)
return;
backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
if (!comboBox.useInt) {
backendValue.setEnumeration(comboBox.scope, comboBox.currentText);
} else {
print("useint" + comboBox.currentIndex)
backendValue.value = comboBox.currentIndex;
}
}
onFocusChanged: {
......
......@@ -84,6 +84,6 @@ Column {
}
TextInputSection {
showEchoMode: false
}
}
......@@ -37,6 +37,9 @@ Section {
anchors.right: parent.right
caption: qsTr("Text Input")
property bool showEchoMode: false
id: textInputSection
SectionLayout {
rows: 4
columns: 2
......@@ -52,12 +55,12 @@ Section {
}
Label {
visible: showVerticalAlignment
text: qsTr("Echo mode")
visible: textInputSection.showEchoMode
text: qsTr("Echo mode")
}
ComboBox {
visible: showVerticalAlignment
visible: textInputSection.showEchoMode
Layout.fillWidth: true
backendValue: backendValues.echoMode
scope: "TextInput"
......
......@@ -70,6 +70,7 @@ Column {
}
TextInputSection {
showEchoMode: true
}
}
......@@ -124,6 +124,7 @@ Column {
SecondColumnLayout {
ComboBox {
useInteger: true
backendValue: backendValues.echoMode
implicitWidth: 180
model: ["Normal", "Password", "PasswordEchoOnEdit", "NoEcho"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment