From 2c6052cfccb18a66b388acebb1010312ba406239 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 3 Jun 2016 23:40:45 +0000 Subject: [PATCH] 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 --- Modes.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modes.hpp b/Modes.hpp index a16e6729d..98e146586 100644 --- a/Modes.hpp +++ b/Modes.hpp @@ -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;