diff options
Diffstat (limited to 'Qt/mainwindow.cpp')
| -rw-r--r-- | Qt/mainwindow.cpp | 48 | 
1 files changed, 0 insertions, 48 deletions
| diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp deleted file mode 100644 index c475414..0000000 --- a/Qt/mainwindow.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "mainwindow.h" -#include "./ui_mainwindow.h" -#include "main.h" - -MainWindow::MainWindow(QWidget *parent) -    : QMainWindow(parent) -    , ui(new Ui::MainWindow) -{ -//    db = QSqlDatabase::addDatabase("QMYSQL"); -    ui->setupUi(this); -} - -MainWindow::~MainWindow() -{ -    dbRef.close(); -    delete ui; -} - -void MainWindow::on_actionAbout_triggered() -{ -    QMessageBox::warning(this, "Oops..", "Task Failed succesfully ;)"); -} - - -void MainWindow::on_pushButton_clicked() -{ -//    dbRef = QSqlDatabase::addDatabase("QMYSQL"); -//    dbRef.setHostName("localhost"); -//    dbRef.setUserName("root"); -//    dbRef.setPassword("Ab12345!"); -//    dbRef.setDatabaseName("thecrapbox"); - -    if(dbRef.open()){ -        QMessageBox::information(this, "Connection", "GREAT SUCCES!"); -        pQueryModel = new QSqlQueryModel(); -        pQueryModel->setQuery("SELECT * FROM opleiding;"); -        ui->tableView->setModel(pQueryModel); -    } else { -        QMessageBox::warning(this, "No connection", "Failed to connect"); -    } -} - -void MainWindow::on_actionConnection_triggered() -{ -    _dbConenctor = new dbConnector(this); -    _dbConenctor->show(); -} - |