mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 01:43:27 +02:00
Case 21119, 21120
Case 21119 - text filter doesn't change as you type in new (qml) marketplace Case 21120 - text filter doesn't clear in new (qml) marketplace
This commit is contained in:
parent
8faff57033
commit
a0199c5884
1 changed files with 14 additions and 9 deletions
|
@ -316,23 +316,28 @@ Rectangle {
|
|||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
placeholderText: "Search Marketplace"
|
||||
|
||||
Timer {
|
||||
id: keypressTimer
|
||||
running: false
|
||||
repeat: false
|
||||
interval: 300
|
||||
onTriggered: searchField.accepted()
|
||||
|
||||
}
|
||||
|
||||
// workaround for https://bugreports.qt.io/browse/QTBUG-49297
|
||||
Keys.onPressed: {
|
||||
switch (event.key) {
|
||||
case Qt.Key_Return:
|
||||
case Qt.Key_Enter:
|
||||
event.accepted = true;
|
||||
searchField.text = "";
|
||||
|
||||
// emit accepted signal manually
|
||||
if (acceptableInput) {
|
||||
searchField.accepted();
|
||||
searchField.forceActiveFocus();
|
||||
}
|
||||
getMarketplaceItems();
|
||||
searchField.forceActiveFocus();
|
||||
break;
|
||||
case Qt.Key_Backspace:
|
||||
if (searchField.text === "") {
|
||||
primaryFilter_index = -1;
|
||||
}
|
||||
default:
|
||||
keypressTimer.restart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue