- QHBoxLayout *layout = new QHBoxLayout;
- layout->addWidget(button);
- layout->setAlignment(button, Qt::AlignLeft);
- layout->addWidget(field);
- layout->setAlignment(field, Qt::AlignRight);
- setLayout(layout);
+ QObject::connect(colorButtons,
+ SIGNAL(flood(int)),
+ field,
+ SLOT(flood(int)));
+
+ turnsLabel = new QLabel(this);
+
+ QObject::connect(field,
+ SIGNAL(turnsChanged(int)),
+ this,
+ SLOT(updateTurns(int)));
+
+ updateTurns(turns);
+
+ QVBoxLayout *vl = new QVBoxLayout;
+ vl->addWidget(turnsLabel);
+ vl->setAlignment(turnsLabel, Qt::AlignTop);
+
+ QHBoxLayout *hl = new QHBoxLayout;
+ hl->addWidget(colorButtons);
+ hl->setAlignment(colorButtons, Qt::AlignLeft);
+ hl->addWidget(field);
+ hl->setAlignment(field, Qt::AlignRight);
+
+ vl->addLayout(hl);
+ setLayout(vl);