mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
QML UI: better simulation of onPressed in TextField
Prior to Qt Quick Components 2.1 there was no onPressed signal for a
TextField; in order to be able to build against Qt 5.7 (which comes with
Qt Quick Components 2.0) we need to work around the lack of this signal.
This code seems to do a pretty good job at simulating it.
My attempt in commit 73c66e1d7d
("QML UI: make run with Qt 5.7 again")
didn't work so well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ee4ae49d37
commit
c00b14af9a
1 changed files with 7 additions and 1 deletions
|
@ -13,7 +13,13 @@ TextField {
|
|||
onTextChanged: {
|
||||
textUpdateTimer.restart();
|
||||
}
|
||||
Keys.onPressed: frame.shouldShow = !frame.shouldShow
|
||||
onFocusChanged: frame.shouldShow = focus
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
focus = false
|
||||
frame.shouldShow = false
|
||||
}
|
||||
}
|
||||
Keys.onUpPressed: {
|
||||
hintsView.currentIndex--;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue