Einloggen funktioniert
This commit is contained in:
96
Gui/LoginScreen.qml
Normal file
96
Gui/LoginScreen.qml
Normal file
@@ -0,0 +1,96 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
ColumnLayout
|
||||
{
|
||||
|
||||
anchors.fill: parent
|
||||
Item
|
||||
{
|
||||
height: 150
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: qsTr ("Login")
|
||||
font.pixelSize: 49
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 15
|
||||
Label
|
||||
{
|
||||
text: qsTr ("Benutzername")
|
||||
minimumPixelSize: 20
|
||||
Layout.preferredWidth: 150
|
||||
horizontalAlignment: Text.AlignRight
|
||||
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: benutzerName
|
||||
placeholderText: qsTr ("Benutzernamen eingeben")
|
||||
implicitWidth: 300
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 15
|
||||
Label
|
||||
{
|
||||
minimumPixelSize: 20
|
||||
Layout.preferredWidth: 150
|
||||
text: qsTr ("Passwort")
|
||||
|
||||
horizontalAlignment: Text.AlignRight
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: passwort
|
||||
placeholderText: qsTr ("Passwort eingeben")
|
||||
implicitWidth: 300
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.preferredWidth: 465
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Button
|
||||
{
|
||||
text: qsTr ("Feierabend für heute!")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
onClicked:
|
||||
{
|
||||
if (benutzerName.text.trim() && passwort.text.trim())
|
||||
loggedin_user.login(benutzerName.text.trim(), passwort.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
|
||||
}
|
||||
}
|
||||
Component.onCompleted:
|
||||
{
|
||||
loggedin_user.loginOkay.connect(loggedin)
|
||||
}
|
||||
function loggedin()
|
||||
{
|
||||
appLoader.source = "Dashboard.qml"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user