aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2020-08-14 13:41:08 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2020-08-17 07:17:26 +0000
commit7adc062cf9370cb81c6766020a82ab5dc1f9e849 (patch)
tree26bc18ca4a15178c2ba5feeae94074b2e70e7104 /share
parenta0067e9444defc21d45e9f3705a97fd4065810fd (diff)
QmlDesigner: Allow plain expressions to be set with LineEdit control
Task-number: QDS-2603 Change-Id: I10a1b513bc21b8736683d4ddc2e290c29b39696d Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml14
1 files changed, 11 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml
index 4a544a0f6a..423a1aa109 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml
@@ -40,6 +40,7 @@ StudioControls.TextField {
translationIndicatorVisible: showTranslateCheckBox
property bool writeValueManually: false
+ property bool writeAsExpression: false
property bool __dirty: false
@@ -93,7 +94,10 @@ StudioControls.TextField {
target: modelNodeBackend
onSelectionToBeChanged: {
if (__dirty && !writeValueManually) {
- lineEdit.backendValue.value = text
+ if (writeAsExpression)
+ lineEdit.backendValue.expression = text
+ else
+ lineEdit.backendValue.value = text
} else if (__dirty) {
commitData()
}
@@ -112,8 +116,12 @@ StudioControls.TextField {
if (backendValue.isTranslated) {
setTranslateExpression()
} else {
- if (lineEdit.backendValue.value !== text)
- lineEdit.backendValue.value = text;
+ if (writeAsExpression) {
+ if (lineEdit.backendValue.expression !== text)
+ lineEdit.backendValue.expression = text
+ } else if (lineEdit.backendValue.value !== text) {
+ lineEdit.backendValue.value = text
+ }
}
__dirty = false
}