File indexing completed on 2024-04-21 15:07:55

0001 // SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-or-later
0004 
0005 #include "minesweepermodel.h"
0006 
0007 MinesweeperModel::MinesweeperModel(QObject *parent)
0008     : QAbstractTableModel(parent)
0009 {
0010 }
0011 
0012 int MinesweeperModel::column() const
0013 {
0014     return m_column;
0015 }
0016 
0017 void MinesweeperModel::setColumn(int column)
0018 {
0019     if (column == m_column) {
0020         return;
0021     }
0022     m_column = column;
0023     Q_EMIT columnChanged();
0024 }
0025 
0026 int MinesweeperModel::row() const
0027 {
0028     return m_row;
0029 }
0030 
0031 void MinesweeperModel::setRow(int row)
0032 {
0033     if (row == m_row) {
0034         return;
0035     }
0036     m_row = row;
0037     Q_EMIT rowChanged();
0038 }
0039 
0040 int MinesweeperModel::columnCount(const QModelIndex &parent) const
0041 {
0042     Q_UNUSED(parent);
0043     return m_column;
0044 }
0045 
0046 int MinesweeperModel::rowCount(const QModelIndex &parent) const
0047 {
0048     Q_UNUSED(parent);
0049     return m_row;
0050 }
0051 
0052 QVariant MinesweeperModel::data(const QModelIndex &index, int role) const
0053 {
0054 }
0055 #include "moc_minesweepermodel.cpp"