Einloggen funktioniert

This commit is contained in:
2024-12-03 16:30:56 +01:00
parent b028638d56
commit 7157176b5b
13 changed files with 804 additions and 50 deletions

96
Gui/LoginScreen.qml Normal file
View 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"
}
}

View File

@@ -6,21 +6,6 @@ import QtQuick.Dialogs
import "../js/qmldict.js" as Qmldict
// Item {
// benutzername
// passwort
// server
// port
// benutzername(db)
// passwort(db)
// DbName
// type
// }
Item
{
Component.onCompleted:

View File

@@ -54,7 +54,7 @@ ApplicationWindow
{
importDialog.open()
}
else appLoader.source= "Dashboard.qml"
else appLoader.source= "LoginScreen.qml"
}
Dialog