QmlDesigner: Fix QtDS crash in Property Editor

* Remove dot handling in ExpressionTextField as it was triggering a
  crash of QtDS
* Secure ExpressionTextField with validator to avoid false input

Task-number: QDS-15509
Change-Id: I3fd9632e8d202a633d6f405ce5523d15088ecb6f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
(cherry picked from commit ee83670597)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Henning Gruendl
2025-06-05 10:46:50 +02:00
committed by Henning Gründl
parent cb5f27b414
commit 97a649deca
2 changed files with 3 additions and 11 deletions

View File

@@ -58,6 +58,9 @@ Section {
anchors.fill: parent anchors.fill: parent
visible: false visible: false
fixedSize: true fixedSize: true
validator: RegularExpressionValidator {
regularExpression: /^[\d\w]*$/
}
property bool blockEditingFinished: false property bool blockEditingFinished: false

View File

@@ -15,8 +15,6 @@ StudioControls.TextField {
property bool completeOnlyTypes: false property bool completeOnlyTypes: false
property bool completionActive: listView.model !== null property bool completionActive: listView.model !== null
property bool dotCompletion: false
property int dotCursorPos: 0
property string prefix property string prefix
property bool fixedSize: false property bool fixedSize: false
property bool replaceCurrentTextByCompletion: false property bool replaceCurrentTextByCompletion: false
@@ -146,14 +144,6 @@ StudioControls.TextField {
switch (event.key) { switch (event.key) {
case Qt.Key_Period:
textField.dotCursorPos = textField.cursorPosition + 1
text = textField.text + "."
pos = textField.dotCursorPos
explicitComplete = false
textField.dotCompletion = true
break
case Qt.Key_Right: case Qt.Key_Right:
if (!textField.completionActive) if (!textField.completionActive)
return return
@@ -209,7 +199,6 @@ StudioControls.TextField {
// list.pop() // list.pop()
// listView.model = list // listView.model = list
// textField.dotCompletion = false
// event.accepted = true // event.accepted = true
// } else { // } else {