Skip to content

Commit

Permalink
removed manual sending of signal about finishing editing
Browse files Browse the repository at this point in the history
after focus = false validation of the entered value occurs before sending finish editing
  • Loading branch information
Eism committed Dec 9, 2024
1 parent 69abd59 commit dc9d0fb
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,12 @@ FocusScope {
event.accepted = false

root.focus = false
root.textEditingFinished(valueInput.text)
}
}

Keys.onPressed: function(event) {
var isAcceptKey = event.key === Qt.Key_Enter || event.key === Qt.Key_Return
var isEscapeKey = event.key === Qt.Key_Escape
if (isAcceptKey || isEscapeKey) {
root.textEditingFinished(valueInput.text)
}

if (isAcceptKey) {
root.accepted()
Expand All @@ -227,7 +223,6 @@ FocusScope {
selectAll()
} else {
deselect()
root.textEditingFinished(valueInput.text)
}
}

Expand All @@ -246,6 +241,10 @@ FocusScope {

root.textEdited(text)
}

onEditingFinished: {
root.textEditingFinished(valueInput.text)
}
}

StyledTextLabel {
Expand Down

0 comments on commit dc9d0fb

Please sign in to comment.