-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddMatchDialog.cpp
37 lines (29 loc) · 1.02 KB
/
AddMatchDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "AddMatchDialog.h"
#include "ui_AddMatchDialog.h"
#include "Match.h"
AddMatchDialog::AddMatchDialog(std::shared_ptr<Round> R, QWidget *parent) :
QDialog(parent),
ui(new Ui::AddMatchDialog)
{
ui->setupUi(this);
ui->okButton->setVisible(false);
this->round = R;
ui->okButton->setStyleSheet("QPushButton::hover{background-color : lightgreen;}"
"QPushButton {background-color: #FFFFFF}");
ui->cancelButton->setStyleSheet("QPushButton::hover{background-color : lightgreen;}"
"QPushButton {background-color: #FFFFFF}");
}
AddMatchDialog::~AddMatchDialog()
{
delete ui;
}
void AddMatchDialog::on_lineEdit_textChanged(const QString &arg1)
{
ui->okButton->setVisible(true);
}
void AddMatchDialog::on_okButton_clicked()
{
std::string name = (ui->lineEdit->text()).toStdString();
std::shared_ptr<Match> m = std::make_shared<Match>(name);
this->round->addMatch(m);
}