Destruction added
This commit is contained in:
@@ -8,4 +8,6 @@ LoginFrameController::LoginFrameController()
|
||||
bool LoginFrameController::tryLogin(std::string id, std::string password){
|
||||
//DatabaseHandler dbHandler = new Databasehandler();
|
||||
//dbHandler.CheckValidLogin();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
};
|
||||
Reference in New Issue
Block a user