X-Git-Url: https://git.johniez.cz/?p=aspt.git;a=blobdiff_plain;f=stadiumtab.cc;h=5fd486019b29bc1afee6379601b017e64b49fe91;hp=97f027b989e8943d51fb6894ce25a637b0fbdc9a;hb=5704f6063e2827cba1583b53308f720c7c25eeb7;hpb=b935a223648e5014d780856903a1b421c7e84398
diff --git a/stadiumtab.cc b/stadiumtab.cc
index 97f027b..5fd4860 100644
--- a/stadiumtab.cc
+++ b/stadiumtab.cc
@@ -6,17 +6,26 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode
#include "stadiumtab.h"
+/**
+ * \brief Stadium Tab constructor.
+ */
StadiumTab::StadiumTab(QWidget *parent) : QWidget(parent) {
mainLayout = new QVBoxLayout;
setLayout(mainLayout);
init();
}
+/**
+ * \brief Stadium Tab destructor.
+ */
StadiumTab::~StadiumTab() {
delete label;
delete mainLayout;
}
+/**
+ * \brief Print info about stadium from parsed data.
+ */
void StadiumTab::init() {
int cap = stadium.cap_n.toInt() + stadium.cap_e.toInt() + stadium.cap_w.toInt() + stadium.cap_s.toInt();
QString text;
@@ -50,6 +59,7 @@ void StadiumTab::init() {
if(stadium.wc.toInt() < ((cap+1000)*0.01)) {
text += tr("You need") + " " + QString().setNum((cap+1000)*0.01) + " " + tr("Toilets") + "
";
}
+ // but 60 for 21000 is still ok
if(stadium.bar.toInt() < ((cap+1000)*0.0044)) {
text += tr("You need") + " " + QString().setNum((cap+1000)*0.0044) + " " + tr("Buffets") + "
";
}
@@ -58,10 +68,16 @@ void StadiumTab::init() {
mainLayout->update();
}
+/**
+ * \brief Slot assigned to data change action.
+ */
void StadiumTab::dataChanged() {
rebuildUI();
}
+/**
+ * \brief Destroy current UI and draw it again.
+ */
void StadiumTab::rebuildUI() {
mainLayout->removeWidget(label);
delete label;