2023-05-26 12:53:26 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 16
|
|
|
|
signal finished()
|
|
|
|
signal accepted(string result)
|
|
|
|
|
|
|
|
property string head
|
|
|
|
property string hint
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr(head)
|
|
|
|
font.pixelSize: 20
|
|
|
|
font.bold: true
|
|
|
|
Layout.fillWidth: true
|
2023-06-09 18:18:51 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2023-05-26 12:53:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr(hint)
|
|
|
|
Layout.fillWidth: true
|
2023-06-09 18:18:51 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2023-05-26 12:53:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("validator_hint")
|
|
|
|
Layout.fillWidth: true
|
2023-06-09 18:18:51 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2023-05-26 12:53:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: edit
|
|
|
|
font.pixelSize: 18
|
|
|
|
Layout.fillWidth: true
|
2024-01-24 19:23:29 +00:00
|
|
|
validator: RegularExpressionValidator {
|
|
|
|
regularExpression: /[0-9A-Za-z_]+/
|
|
|
|
}
|
2023-05-26 12:53:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "OK"
|
|
|
|
enabled: edit.text.length >= 4
|
|
|
|
onClicked: {
|
|
|
|
accepted(edit.text);
|
|
|
|
finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|