|
|
@ -3,6 +3,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
extern std::unique_ptr<QSettings> settings;
|
|
|
|
extern std::unique_ptr<QSettings> settings;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// event functions
|
|
|
|
|
|
|
|
void MainWindow::buttonPressed(QPushButton *button) {
|
|
|
|
|
|
|
|
QString text = "owo";
|
|
|
|
|
|
|
|
button->setText(text);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// initialisation functions
|
|
|
|
// initialisation functions
|
|
|
|
void MainWindow::initialiseGameGrid() {
|
|
|
|
void MainWindow::initialiseGameGrid() {
|
|
|
|
qDebug() << "Number of rows: " << n_rows;
|
|
|
|
qDebug() << "Number of rows: " << n_rows;
|
|
|
@ -11,6 +17,21 @@ void MainWindow::initialiseGameGrid() {
|
|
|
|
for (long long i = 0; i < colors.size(); i++) {
|
|
|
|
for (long long i = 0; i < colors.size(); i++) {
|
|
|
|
qDebug() << colors.value(i);
|
|
|
|
qDebug() << colors.value(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < n_columns; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for(int j = 0; j < n_rows; j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QPushButton * button = new QPushButton(this);
|
|
|
|
|
|
|
|
ui->gameGridLayout->addWidget(button, j, i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set size text etc. for each button
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(button, &QPushButton::clicked, [=](){
|
|
|
|
|
|
|
|
buttonPressed(button);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::initialiseWindow() {
|
|
|
|
void MainWindow::initialiseWindow() {
|
|
|
|