From 2d8de1ef8477d71c4d79e1ff292566809296e8fe Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 7 Apr 2011 18:01:35 +0200 Subject: adding application icon and trying to add actor icon. but this is really hackish --- pacman-c++/mainwidget.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'pacman-c++/mainwidget.cpp') 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() " # # " }; - for (unsigned int x = 0; x < Constants::map_size.width; ++x) { for (unsigned int y = 0; y < Constants::map_size.height; ++y) @@ -114,11 +113,12 @@ void MainWidget::createGui() for (unsigned int i = 1; i < 4; ++i) { - QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this); - m_scoreLayout->addWidget(scoreBoxI); + QGroupBox *scoreBox = new QGroupBox(QString(" Spieler %1").arg(i), this); + scoreBox->setObjectName(QString("actor%1").arg(i)); + m_scoreLayout->addWidget(scoreBox); QGridLayout *playerLayout = new QGridLayout(); - scoreBoxI->setLayout(playerLayout); + scoreBox->setLayout(playerLayout); playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0); playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0); @@ -126,6 +126,12 @@ void MainWidget::createGui() playerLayout->addWidget(new QLabel("", this), 0, 1); playerLayout->addWidget(new QLabel("", this), 1, 1); + /*Actor *tmp1 = new Actor(Color::red); + QGraphicsScene *tmp2 = new QGraphicsScene(0, 0, 16, 16, this); + QLabel *tmp3 = new QLabel("hfghgfhgfhgfh", this); + tmp3->setPixmap(QPixmap(":/actor1")); + playerLayout->addWidget(tmp3, 0, 2);*/ + m_playerScoreLayouts.append(playerLayout); } @@ -135,16 +141,19 @@ void MainWidget::createGui() QGraphicsView *window = new QGraphicsView(m_scene, this); window->setFrameStyle(0); window->setAlignment(Qt::AlignLeft | Qt::AlignTop); - //window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - //window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); layout->addLayout(m_scoreLayout); layout->addWidget(window); + QFile css(":/stylesheet"); + css.open(QFile::ReadOnly); + qApp->setStyleSheet(QLatin1String(css.readAll())); + setLayout(layout); - setWindowTitle("pacman client"); + //TODO: this doesn't work?!?! + setWindowTitle("FOOP Pacman Client"); } void MainWidget::updateScore() -- cgit v1.2.3