Destruction added

This commit is contained in:
AJ
2024-06-23 17:28:09 +02:00
parent ce1f261687
commit 63249f7110
3 changed files with 19 additions and 2 deletions

View File

@@ -8,4 +8,6 @@ LoginFrameController::LoginFrameController()
bool LoginFrameController::tryLogin(std::string id, std::string password){
//DatabaseHandler dbHandler = new Databasehandler();
//dbHandler.CheckValidLogin();
return true;
}

View File

@@ -110,11 +110,23 @@ void LoginFrame::loginButtonClicked(){
//check if Contents Valid
if (id.isEmpty() || password.isEmpty()){
QMessageBox::warning(this, "Fehler", "Bitte füllen Sie sowohl die ID als auch das Passwort aus.");
QMessageBox::warning(this, "Error", "Bitte füllen Sie sowohl die ID als auch das Passwort aus.");
}
else {
LoginFrameController* controller = new LoginFrameController();
bool valid = controller->tryLogin(id.toStdString(), password.toStdString());
if (!controller->tryLogin(id.toStdString(), password.toStdString())){
QMessageBox:: warning(this, "Error", "ID und Passwort stimmen nicht überein!");
}
else{
this->~LoginFrame();
}
}
}
LoginFrame::~LoginFrame(){
header_m->~QLabel();
id_m->~QLineEdit();
password_m->~QLineEdit();
loginButton_m->~QPushButton();
parent_m->~QMainWindow();
}

View File

@@ -6,11 +6,13 @@
# include <QLabel>
# include <QVBoxLayout>
# include <QMessageBox>
# include <QMainWindow>
# include "../../Controller/LoginFrameController/LoginFrameController.hpp"
class LoginFrame : public QFrame{
Q_OBJECT
protected:
QMainWindow* parent_m;
QLabel* header_m;
QLineEdit* id_m;
QLineEdit* password_m;
@@ -20,4 +22,5 @@ protected:
public:
LoginFrame(QWidget* parent = nullptr);
~LoginFrame();
};