diff options
Diffstat (limited to 'pacman-c++')
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 23 | ||||
| -rw-r--r-- | pacman-c++/mainwidget.h | 1 | ||||
| -rw-r--r-- | pacman-c++/pacman.pro | 2 | ||||
| -rw-r--r-- | pacman-c++/style.qss | 20 |
4 files changed, 26 insertions, 20 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index e8a4250..96cf62f 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -109,13 +109,15 @@ void MainWidget::createGui() | |||
| 109 | setFocusPolicy(Qt::StrongFocus); | 109 | setFocusPolicy(Qt::StrongFocus); |
| 110 | 110 | ||
| 111 | QVBoxLayout *layout = new QVBoxLayout(this); | 111 | QVBoxLayout *layout = new QVBoxLayout(this); |
| 112 | QHBoxLayout *m_scoreLayout = new QHBoxLayout(); | 112 | QHBoxLayout *scoreLayout = new QHBoxLayout(); |
| 113 | 113 | ||
| 114 | for (unsigned int i = 1; i < 4; ++i) | 114 | for (unsigned int i = 1; i < 4; ++i) |
| 115 | { | 115 | { |
| 116 | QGroupBox *scoreBox = new QGroupBox(QString(" Spieler %1").arg(i), this); | 116 | QGroupBox *scoreBox = new QGroupBox(QString("Spieler %1").arg(i), this); |
| 117 | scoreBox->setObjectName(QString("actor%1").arg(i)); | 117 | scoreBox->setObjectName(QString("actor%1").arg(i)); |
| 118 | m_scoreLayout->addWidget(scoreBox); | 118 | scoreBox->setCheckable(true); |
| 119 | connect(scoreBox, SIGNAL(clicked()), this, SLOT(playerScoreClicked())); | ||
| 120 | scoreLayout->addWidget(scoreBox); | ||
| 119 | 121 | ||
| 120 | QGridLayout *playerLayout = new QGridLayout(); | 122 | QGridLayout *playerLayout = new QGridLayout(); |
| 121 | scoreBox->setLayout(playerLayout); | 123 | scoreBox->setLayout(playerLayout); |
| @@ -126,12 +128,6 @@ void MainWidget::createGui() | |||
| 126 | playerLayout->addWidget(new QLabel("", this), 0, 1); | 128 | playerLayout->addWidget(new QLabel("", this), 0, 1); |
| 127 | playerLayout->addWidget(new QLabel("", this), 1, 1); | 129 | playerLayout->addWidget(new QLabel("", this), 1, 1); |
| 128 | 130 | ||
| 129 | /*Actor *tmp1 = new Actor(Color::red); | ||
| 130 | QGraphicsScene *tmp2 = new QGraphicsScene(0, 0, 16, 16, this); | ||
| 131 | QLabel *tmp3 = new QLabel("hfghgfhgfhgfh", this); | ||
| 132 | tmp3->setPixmap(QPixmap(":/actor1")); | ||
| 133 | playerLayout->addWidget(tmp3, 0, 2);*/ | ||
| 134 | |||
| 135 | m_playerScoreLayouts.append(playerLayout); | 131 | m_playerScoreLayouts.append(playerLayout); |
| 136 | } | 132 | } |
| 137 | 133 | ||
| @@ -144,7 +140,7 @@ void MainWidget::createGui() | |||
| 144 | window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); | 140 | window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); |
| 145 | window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); | 141 | window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); |
| 146 | 142 | ||
| 147 | layout->addLayout(m_scoreLayout); | 143 | layout->addLayout(scoreLayout); |
| 148 | layout->addWidget(window); | 144 | layout->addWidget(window); |
| 149 | 145 | ||
| 150 | QFile css(":/stylesheet"); | 146 | QFile css(":/stylesheet"); |
| @@ -356,3 +352,10 @@ void MainWidget::startGame() | |||
| 356 | { | 352 | { |
| 357 | m_running = true; | 353 | m_running = true; |
| 358 | } | 354 | } |
| 355 | |||
| 356 | void MainWidget::playerScoreClicked() | ||
| 357 | { | ||
| 358 | QGroupBox *tmp = qobject_cast<QGroupBox *>(sender()); | ||
| 359 | tmp->setChecked(true); | ||
| 360 | return; | ||
| 361 | } | ||
diff --git a/pacman-c++/mainwidget.h b/pacman-c++/mainwidget.h index 6adcba2..f5703db 100644 --- a/pacman-c++/mainwidget.h +++ b/pacman-c++/mainwidget.h | |||
| @@ -29,6 +29,7 @@ private: | |||
| 29 | 29 | ||
| 30 | private slots: | 30 | private slots: |
| 31 | void startGame(); | 31 | void startGame(); |
| 32 | void playerScoreClicked(); | ||
| 32 | 33 | ||
| 33 | private: | 34 | private: |
| 34 | QVector< QVector<PixmapItem *> > visualMap; | 35 | QVector< QVector<PixmapItem *> > visualMap; |
diff --git a/pacman-c++/pacman.pro b/pacman-c++/pacman.pro index e995c81..3826852 100644 --- a/pacman-c++/pacman.pro +++ b/pacman-c++/pacman.pro | |||
| @@ -22,8 +22,6 @@ OBJECTS_DIR = .obj | |||
| 22 | MOC_DIR = .moc | 22 | MOC_DIR = .moc |
| 23 | RC_FILE = pacman.rc | 23 | RC_FILE = pacman.rc |
| 24 | 24 | ||
| 25 | CONFIG += debug | ||
| 26 | |||
| 27 | OTHER_FILES += \ | 25 | OTHER_FILES += \ |
| 28 | style.qss \ | 26 | style.qss \ |
| 29 | pacman.rc | 27 | pacman.rc |
diff --git a/pacman-c++/style.qss b/pacman-c++/style.qss index 74ba1b8..1a24459 100644 --- a/pacman-c++/style.qss +++ b/pacman-c++/style.qss | |||
| @@ -1,27 +1,31 @@ | |||
| 1 | QGroupBox#actor1::title { | 1 | QGroupBox#actor1::indicator { |
| 2 | background-image: url(:/actor1icon); | 2 | background-image: url(:/actor1icon); |
| 3 | background-position: top left; | 3 | background-position: top left; |
| 4 | background-repeat: no-repeat; | 4 | background-repeat: no-repeat; |
| 5 | background-color: palette(window); | 5 | width: 16px; |
| 6 | height: 14px; | ||
| 6 | } | 7 | } |
| 7 | 8 | ||
| 8 | QGroupBox#actor2::title { | 9 | QGroupBox#actor2::indicator { |
| 9 | background-image: url(:/actor2icon); | 10 | background-image: url(:/actor2icon); |
| 10 | background-position: top left; | 11 | background-position: top left; |
| 11 | background-repeat: no-repeat; | 12 | background-repeat: no-repeat; |
| 12 | background-color: palette(window); | 13 | width: 16px; |
| 14 | height: 14px; | ||
| 13 | } | 15 | } |
| 14 | 16 | ||
| 15 | QGroupBox#actor3::title { | 17 | QGroupBox#actor3::indicator { |
| 16 | background-image: url(:/actor3icon); | 18 | background-image: url(:/actor3icon); |
| 17 | background-position: top left; | 19 | background-position: top left; |
| 18 | background-repeat: no-repeat; | 20 | background-repeat: no-repeat; |
| 19 | background-color: palette(window); | 21 | width: 16px; |
| 22 | height: 14px; | ||
| 20 | } | 23 | } |
| 21 | 24 | ||
| 22 | QGroupBox#actor4::title { | 25 | QGroupBox#actor4::indicator { |
| 23 | background-image: url(:/actor4icon); | 26 | background-image: url(:/actor4icon); |
| 24 | background-position: top left; | 27 | background-position: top left; |
| 25 | background-repeat: no-repeat; | 28 | background-repeat: no-repeat; |
| 26 | background-color: palette(window); | 29 | width: 16px; |
| 30 | height: 14px; | ||
| 27 | } | 31 | } |
