forked from Siecje/qml-material-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextFieldDemo.qml
54 lines (46 loc) · 1.4 KB
/
TextFieldDemo.qml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Material 0.2
Item {
implicitHeight: column.height
ColumnLayout {
id: column
anchors.centerIn: parent
spacing: dp(32)
TextField {
text: "Big Field with text"
font.pixelSize: dp(32)
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
placeholderText: "Search..."
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
text: "Text under label"
placeholderText: "Floating label"
floatingLabel: true
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
placeholderText: "Character limit"
floatingLabel: true
characterLimit: 10
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: passwordField
placeholderText: "Password"
floatingLabel: true
echoMode: TextInput.Password
helperText: "Hint: It's not password."
anchors.horizontalCenter: parent.horizontalCenter
onAccepted: {
if (passwordField.text === "password") {
passwordField.helperText = "Told ya."
passwordField.hasError = true
}
}
}
}
}