aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextinput/data/focusOnlyOneOnPress.qml
blob: 037b36c8ff43fd799e1dde4f336550b52b277065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import QtQuick 2.2

Rectangle {
    width: 400
    height: 400

    Column {
        spacing: 5
        TextInput {
            objectName: "first"
            onEditingFinished: second.focus = true
            width: 100
            Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 }
        }
        TextInput {
            id: second
            objectName: "second"
            onEditingFinished: third.focus = true
            width: 100
            Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 }
        }
        TextInput {
            objectName: "third"
            id: third
            width: 100
            Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 }
        }
        Component.onCompleted: {
            second.focus = true
        }
    }
}