You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1021 B
45 lines
1021 B
import QtQuick 2.15
|
|
import QtQuick.Window 2.15
|
|
import QtQuick.Controls 2.15
|
|
import QtQuick.Controls.Material 2.15
|
|
|
|
Item {
|
|
property string input: idText.text
|
|
property string name: ""
|
|
anchors.topMargin: 5
|
|
width: parent.width
|
|
height: 57
|
|
function clear() {
|
|
idText.clear()
|
|
}
|
|
|
|
Label {
|
|
id: idName
|
|
anchors.left: parent.left
|
|
text: parent.name + ":"
|
|
y: 0
|
|
Material.foreground: "#167a72"
|
|
font.pointSize: 10
|
|
visible: false
|
|
}
|
|
TextField {
|
|
id: idText
|
|
y: 10
|
|
horizontalAlignment: TextInput.AlignHCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
width: parent.width
|
|
selectByMouse: true
|
|
onTextChanged: {
|
|
|
|
if (text === "") {
|
|
placeholderText = name
|
|
idName.visible = false
|
|
} else {
|
|
placeholderText = ""
|
|
idName.visible = true
|
|
}
|
|
}
|
|
|
|
placeholderText: name
|
|
}
|
|
}
|
|
|