From 57389c1e340ea8dea70604cbe14a43b3696eb6c0 Mon Sep 17 00:00:00 2001 From: York Date: Sun, 11 Jun 2017 01:06:38 +0300 Subject: [PATCH] bug solved --- Sources/mainwindow.cpp | 76 ++++++++++++++++++++++++++++++------------ Sources/mainwindow.h | 1 - 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/Sources/mainwindow.cpp b/Sources/mainwindow.cpp index 7e2ed7e..4eefcf6 100644 --- a/Sources/mainwindow.cpp +++ b/Sources/mainwindow.cpp @@ -12,7 +12,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) CreateWidgets(); CreateMapping(); CreateSizePolicy(); - CreateObjectNames(); CreateBeginButtonsStyle(); setWindowTitle("TickTackToe"); @@ -129,28 +128,8 @@ void MainWindow::CreateMapping() connect(game_button_mapper, SIGNAL(mapped(int)), this, SLOT(slotGameButtonPressed(int)), Qt::UniqueConnection); } -void MainWindow::CreateObjectNames() -{ - button_0->setObjectName("game_button"); - button_1->setObjectName("game_button"); - button_2->setObjectName("game_button"); - button_3->setObjectName("game_button"); - button_4->setObjectName("game_button"); - button_5->setObjectName("game_button"); - button_6->setObjectName("game_button"); - button_7->setObjectName("game_button"); - button_8->setObjectName("game_button"); -} - void MainWindow::CreateBeginButtonsStyle() { - this->setStyleSheet( - "QPushButton {" - "border: 2px solid #afafaf;" - "background-color: white;" - "}" - ); - button_0->setText(""); button_1->setText(""); button_2->setText(""); @@ -160,6 +139,61 @@ void MainWindow::CreateBeginButtonsStyle() button_6->setText(""); button_7->setText(""); button_8->setText(""); + + button_0->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_1->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_2->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_3->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_4->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_5->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_6->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_7->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); + button_8->setStyleSheet( + "QPushButton {" + "border: 2px solid #afafaf;" + "background-color: white;" + "}" + ); } void MainWindow::ChangeBoard(int button_number) diff --git a/Sources/mainwindow.h b/Sources/mainwindow.h index 2afb9da..6ec2f35 100644 --- a/Sources/mainwindow.h +++ b/Sources/mainwindow.h @@ -43,7 +43,6 @@ private : //widgets functions void CreateWidgets(); void CreateSizePolicy(); - void CreateObjectNames(); void CreateMapping(); void CreateBeginButtonsStyle();