return size;
}
+void Field::setSize (int size)
+{
+ Q_ASSERT(size >= 0 && size < NUM_SIZES);
+
+ if (this->size == size)
+ return;
+
+ this->size = (FieldSize)size;
+ randomize();
+}
+
void Field::randomize ()
{
FieldRect rect;
tryFloodRecurse(brush, x, y + 1);
}
-void Field::mousePressEvent (QMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton)
- randomize();
-}
-
void Field::paintEvent (QPaintEvent *event)
{
QPainter painter;
if (finished)
{
QMessageBox box;
+ box.setWindowTitle("Color Flood");
box.setText(msg);
box.exec();
randomize();