summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
-rw-r--r--pacman-c++/mainwidget.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp
index 780312f..e8a4250 100644
--- a/pacman-c++/mainwidget.cpp
+++ b/pacman-c++/mainwidget.cpp
@@ -46,7 +46,6 @@ Transmission::map_t createDummyMap()
46 " # # " 46 " # # "
47 }; 47 };
48 48
49
50 for (unsigned int x = 0; x < Constants::map_size.width; ++x) 49 for (unsigned int x = 0; x < Constants::map_size.width; ++x)
51 { 50 {
52 for (unsigned int y = 0; y < Constants::map_size.height; ++y) 51 for (unsigned int y = 0; y < Constants::map_size.height; ++y)
@@ -114,11 +113,12 @@ void MainWidget::createGui()
114 113
115 for (unsigned int i = 1; i < 4; ++i) 114 for (unsigned int i = 1; i < 4; ++i)
116 { 115 {
117 QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this); 116 QGroupBox *scoreBox = new QGroupBox(QString(" Spieler %1").arg(i), this);
118 m_scoreLayout->addWidget(scoreBoxI); 117 scoreBox->setObjectName(QString("actor%1").arg(i));
118 m_scoreLayout->addWidget(scoreBox);
119 119
120 QGridLayout *playerLayout = new QGridLayout(); 120 QGridLayout *playerLayout = new QGridLayout();
121 scoreBoxI->setLayout(playerLayout); 121 scoreBox->setLayout(playerLayout);
122 122
123 playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0); 123 playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0);
124 playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0); 124 playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0);
@@ -126,6 +126,12 @@ void MainWidget::createGui()
126 playerLayout->addWidget(new QLabel("", this), 0, 1); 126 playerLayout->addWidget(new QLabel("", this), 0, 1);
127 playerLayout->addWidget(new QLabel("", this), 1, 1); 127 playerLayout->addWidget(new QLabel("", this), 1, 1);
128 128
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
129 m_playerScoreLayouts.append(playerLayout); 135 m_playerScoreLayouts.append(playerLayout);
130 } 136 }
131 137
@@ -135,16 +141,19 @@ void MainWidget::createGui()
135 QGraphicsView *window = new QGraphicsView(m_scene, this); 141 QGraphicsView *window = new QGraphicsView(m_scene, this);
136 window->setFrameStyle(0); 142 window->setFrameStyle(0);
137 window->setAlignment(Qt::AlignLeft | Qt::AlignTop); 143 window->setAlignment(Qt::AlignLeft | Qt::AlignTop);
138 //window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
139 //window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
140 window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); 144 window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height);
141 window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); 145 window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint);
142 146
143 layout->addLayout(m_scoreLayout); 147 layout->addLayout(m_scoreLayout);
144 layout->addWidget(window); 148 layout->addWidget(window);
145 149
150 QFile css(":/stylesheet");
151 css.open(QFile::ReadOnly);
152 qApp->setStyleSheet(QLatin1String(css.readAll()));
153
146 setLayout(layout); 154 setLayout(layout);
147 setWindowTitle("pacman client"); 155 //TODO: this doesn't work?!?!
156 setWindowTitle("FOOP Pacman Client");
148} 157}
149 158
150void MainWidget::updateScore() 159void MainWidget::updateScore()