Changeset c00b14a in subsurface


Ignore:
Timestamp:
Apr 14, 2017, 2:04:34 PM (10 days ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
e42bf2c
Parents:
ee4ae49
git-author:
Dirk Hohndel <dirk@…> (04/14/17 14:03:51)
git-committer:
Dirk Hohndel <dirk@…> (04/14/17 14:04:34)
Message:

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 73c66e1d7d9f ("QML UI: make run with Qt 5.7 again")
didn't work so well.

Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qml/HintsTextEdit.qml

    ree4ae49 rc00b14a  
    1414                textUpdateTimer.restart();
    1515        }
    16         Keys.onPressed: frame.shouldShow = !frame.shouldShow
     16        onFocusChanged: frame.shouldShow = focus
     17        onVisibleChanged: {
     18                if (visible) {
     19                        focus = false
     20                        frame.shouldShow = false
     21                }
     22        }
    1723        Keys.onUpPressed: {
    1824                hintsView.currentIndex--;
Note: See TracChangeset for help on using the changeset viewer.