From 47ed83204245dfb34e0c6bbddf9b8f66e275a89d Mon Sep 17 00:00:00 2001 From: Alexandr Akulich Date: Thu, 10 Mar 2016 14:54:43 +0500 Subject: [PATCH] CellItem: Render only opened cells Closes #15. --- CellItem.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CellItem.cpp b/CellItem.cpp index 7ff0e45..c2a834a 100644 --- a/CellItem.cpp +++ b/CellItem.cpp @@ -33,10 +33,12 @@ void CellItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, painter->drawRect(0, 0, cellSize, cellSize); - if (m_cell->haveMine()) { - m_text->setText("+"); - } else if (m_cell->minesAround() > 0) { - m_text->setText(QString::number(m_cell->minesAround())); + if (m_cell->isOpen()) { + if (m_cell->haveMine()) { + m_text->setText("+"); + } else if (m_cell->minesAround() > 0) { + m_text->setText(QString::number(m_cell->minesAround())); + } } }