-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomTextInput.qml
More file actions
42 lines (36 loc) · 920 Bytes
/
Copy pathCustomTextInput.qml
File metadata and controls
42 lines (36 loc) · 920 Bytes
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
import QtQuick 2.0
Item {
//Set location
property int var_minusx
property int var_y
//Set title of input box
property string header
//Bind the textinput subelement as textInput
property alias textInput: _a
//Background Rectangle
Rectangle {
x: mainwindow.width - var_minusx - 200
y: var_y
width: 200
height: 90
radius: 10
color: "teal"
//Title of text input
Text {
text: header
font.pixelSize: parent.height/2.5
}
//Where we type into
TextInput {
//Other end of the binding
id: _a
y: 40
//Align text centre
horizontalAlignment: TextInput.AlignHCenter
font.pixelSize: parent.height/2
width: parent.width
height: parent.height
color: "white"
}
}
}