diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-10-27 10:46:30 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-10-27 10:46:30 +0200 |
commit | c363bf7fb006914dbcfadb0a752c05fdf8683400 (patch) | |
tree | f1bb77c9a5270b9e27b0cc2c48ecabcf5eb474f7 /client/dbconnector.cpp | |
parent | 183ed1e4c58f0c788db0b56886aad2dc258e9ddb (diff) | |
parent | 28af8ed412224bd8969db98521b67e0f4027ddf7 (diff) |
Merge branch 'devs' of https://github.com/UnavailableDev/avans-whether-station-Qt into dev-merge-temp
Diffstat (limited to 'client/dbconnector.cpp')
-rw-r--r-- | client/dbconnector.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/client/dbconnector.cpp b/client/dbconnector.cpp index 5ed1efc..186f8f7 100644 --- a/client/dbconnector.cpp +++ b/client/dbconnector.cpp @@ -2,7 +2,7 @@ #include "ui_dbconnector.h" #include "main.h" -//#include "mainwindow.h" +#include "mainwindow.h" dbConnector::dbConnector(QWidget *parent) : QDialog(parent), @@ -26,19 +26,16 @@ void dbConnector::on_pushButton_login_clicked() QString hostname = ui->lineEdit_adress->text(); QString username = ui->lineEdit_username->text(); QString password = ui->lineEdit_password->text(); - QString databaseName = "thecrapbox"; + QString databaseName = ui->lineEdit_database->text(); -// QSqlDatabase db = MainWindow.loginDb(adress, username, password); - -// QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); -// return; dbRef.setHostName(hostname); dbRef.setUserName(username); dbRef.setPassword(password); - dbRef.setDatabaseName("thecrapbox"); + dbRef.setDatabaseName(databaseName); if(dbRef.open()){ QMessageBox::information(this, "Connection", "GREAT SUCCES!"); + dbConnector::~dbConnector(); } else { QMessageBox::warning(this, "No connection", "Failed to connect"); } |