From 0ef2d7931ba97db3105e6099cfc277f28ee2f6c6 Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 14 Apr 2011 20:58:59 +0200 Subject: instead of displaying the score of all possible players only display scores up to maxplayers --- pacman-c++/mainwidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 1fc7687..daa5806 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp @@ -59,13 +59,15 @@ void MainWidget::createGui() QVBoxLayout *layout = new QVBoxLayout(this); layout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); QHBoxLayout *scoreLayout = new QHBoxLayout(); - for (unsigned int i = 0; Color::order[i] != Color::none; ++i) + for (unsigned int i = 0; i < m_maxplayers; ++i) { QGridLayout *playerLayout = new QGridLayout(); playerLayout->addWidget(new QLabel("Current:", this), 0, 0); playerLayout->addWidget(new QLabel("Total:", this), 1, 0); - playerLayout->addWidget(new QLabel("0", this), 0, 1); - playerLayout->addWidget(new QLabel("0", this), 1, 1); + playerLayout->addWidget(new QLabel("0", this), 0, 1, Qt::AlignLeft); + playerLayout->addWidget(new QLabel("0", this), 1, 1, Qt::AlignLeft); + playerLayout->setColumnStretch(1, 10); + playerLayout->setSizeConstraint(QLayout::SetMinimumSize); QGroupBox *scoreBox = new QGroupBox(QString("Player %1").arg(i + 1), this); scoreBox->setObjectName(QString("actor%1").arg(i + 1)); -- cgit v1.2.3