diff -r 4feced261c68 -r de822cd3df3a QTfrontend/ui/page/pagegamestats.cpp --- a/QTfrontend/ui/page/pagegamestats.cpp Tue Jan 21 22:38:13 2014 +0100 +++ b/QTfrontend/ui/page/pagegamestats.cpp Tue Jan 21 22:43:06 2014 +0100 @@ -40,13 +40,13 @@ QLayout * PageGameStats::bodyLayoutDefinition() { - kindOfPoints = QString(""); - defaultGraphTitle = true; + kindOfPoints = QString(""); + defaultGraphTitle = true; QGridLayout * pageLayout = new QGridLayout(); pageLayout->setSpacing(20); pageLayout->setColumnStretch(0, 1); pageLayout->setColumnStretch(1, 1); - pageLayout->setRowStretch(0, 1); + pageLayout->setRowStretch(0, 1); pageLayout->setRowStretch(1, 20); //pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used pageLayout->setContentsMargins(7, 7, 7, 0); @@ -106,11 +106,11 @@ QLayout * PageGameStats::footerLayoutDefinition() { QHBoxLayout * bottomLayout = new QHBoxLayout(); - + mainNote = new QLabel(this); mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); mainNote->setWordWrap(true); - + bottomLayout->addWidget(mainNote, 0); bottomLayout->setStretch(0,1); @@ -159,41 +159,41 @@ void PageGameStats::renderStats() { - graphic->show(); - labelGraphTitle-> show(); - if(defaultGraphTitle) { - labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); - } else { - defaultGraphTitle = true; - } - // if not health data sent - if(healthPoints.size() == 0) { - labelGraphTitle->hide(); - graphic->hide(); - } else { - QGraphicsScene * scene = new QGraphicsScene(); + graphic->show(); + labelGraphTitle-> show(); + if(defaultGraphTitle) { + labelGraphTitle->setText("

" + PageGameStats::tr("Health graph") + "

"); + } else { + defaultGraphTitle = true; + } + // if not health data sent + if(healthPoints.size() == 0) { + labelGraphTitle->hide(); + graphic->hide(); + } else { + QGraphicsScene * scene = new QGraphicsScene(); - QMap >::const_iterator i = healthPoints.constBegin(); - while (i != healthPoints.constEnd()) - { - quint32 c = i.key(); - //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255)); - QVector hps = i.value(); + QMap >::const_iterator i = healthPoints.constBegin(); + while (i != healthPoints.constEnd()) + { + quint32 c = i.key(); + //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255)); + QVector hps = i.value(); - QPainterPath path; - if (hps.size()) - path.moveTo(0, hps[0]); + QPainterPath path; + if (hps.size()) + path.moveTo(0, hps[0]); - for(int t = 1; t < hps.size(); ++t) - path.lineTo(t, hps[t]); + for(int t = 1; t < hps.size(); ++t) + path.lineTo(t, hps[t]); - scene->addPath(path, QPen(c)); - ++i; - } + scene->addPath(path, QPen(c)); + ++i; + } - graphic->setScene(scene); - graphic->fitInView(graphic->sceneRect()); - } + graphic->setScene(scene); + graphic->fitInView(graphic->sceneRect()); + } } void PageGameStats::GameStats(char type, const QString & info) @@ -237,9 +237,9 @@ } case 'g' : { - // TODO: change default picture or add change pic capability - defaultGraphTitle = false; - labelGraphTitle->setText("

" + info + "

"); + // TODO: change default picture or add change pic capability + defaultGraphTitle = false; + labelGraphTitle->setText("

" + info + "

"); break; } case 'T': // local team stats @@ -257,7 +257,7 @@ } break; } - case 'p' : + case 'p' : { kindOfPoints = info; break; @@ -300,11 +300,11 @@ QString message; QString killstring; if(kindOfPoints.compare("") == 0) { - killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills); - } else { - killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints); - kindOfPoints = QString(""); - } + killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills); + } else { + killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints); + kindOfPoints = QString(""); + } message = QString("

%1 %2. %3 ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "

";