replaced pointer by smart pointers
This commit is contained in:
@@ -43,7 +43,7 @@ MainWindow::MainWindow(QWidget * parent)
|
||||
QObject::connect(startRennen, SIGNAL(activated()), this,
|
||||
SLOT(WindowRennen()));
|
||||
|
||||
this->db = new DataBase;
|
||||
this->db = std::make_shared<DataBase>();
|
||||
|
||||
// vector<vector<QString>> daten = db->getData("select * from Fahrer", 2);
|
||||
}
|
||||
@@ -52,17 +52,18 @@ void MainWindow::closeEvent(QCloseEvent * event) {
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
delete this->db;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::WindowTraining() {
|
||||
this->interfaceTraining = new Training(this, this->db);
|
||||
// this->interfaceTraining = new Training(this, this->db);
|
||||
this->interfaceTraining = std::make_shared<Training>(this, this->db);
|
||||
this->interfaceTraining->show();
|
||||
}
|
||||
|
||||
void MainWindow::NewWindowSettings() {
|
||||
this->interfaceSettings = new WindowsSettings(this->db, this);
|
||||
this->interfaceSettings =
|
||||
std::make_shared<WindowsSettings>(this->db.get(), this);
|
||||
this->interfaceSettings->show();
|
||||
}
|
||||
|
||||
@@ -107,15 +108,16 @@ void MainWindow::WindowRennen() {
|
||||
Q_UNUSED(e);
|
||||
}
|
||||
|
||||
this->interfaceRace = new WindowRace(this->db, this);
|
||||
this->interfaceRace = std::make_shared<WindowRace>(this->db, this);
|
||||
this->interfaceRace->show();
|
||||
this->interfaceRennliste = new WindowRennliste(this->db, this);
|
||||
this->interfaceRennliste =
|
||||
std::make_shared<WindowRennliste>(this->db.get(), this);
|
||||
this->interfaceRennliste->show();
|
||||
this->interfaceRace->setWindowRennliste(this->interfaceRennliste);
|
||||
this->interfaceRennliste->setWindowRace(this->interfaceRace);
|
||||
this->interfaceRennliste->setWindowRace(this->interfaceRace.get());
|
||||
}
|
||||
|
||||
void MainWindow::WindowEvaluation() {
|
||||
this->interfaceEvaluation = new Evaluation(this->db);
|
||||
this->interfaceEvaluation = std::make_shared<Evaluation>(this->db.get());
|
||||
this->interfaceEvaluation->show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user