Automate counting of rows in the Modes model

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6725 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-06-03 23:40:45 +00:00
parent 6eb55cee68
commit 3a0602711c

View File

@ -23,6 +23,7 @@ public:
ISCAT,
JTMSK,
MSK144,
MODES_END_SENTINAL_AND_COUNT // this must be last
};
Q_ENUM (Mode)
@ -34,7 +35,7 @@ public:
// Implement the QAbstractListModel interface
int rowCount (QModelIndex const& parent = QModelIndex {}) const override
{
return parent.isValid () ? 0 : 8; // Number of modes in Mode enumeration class
return parent.isValid () ? 0 : MODES_END_SENTINAL_AND_COUNT; // Number of modes in Mode enumeration class
}
QVariant data (QModelIndex const&, int role = Qt::DisplayRole) const override;
QVariant headerData (int section, Qt::Orientation, int = Qt::DisplayRole) const override;