8 #include <ConfigHolder.h>
11 #include "ListModel.h"
13 using namespace freeRecite
;
15 ListModel::ListModel(QObject
*parent
)
16 : QAbstractListModel(parent
)
21 ListModel::~ListModel() {
23 qDebug("~ListModel()");
27 void ListModel::addToList(const QString
&word
) {
28 if(!words
.contains(word
)){
34 int ListModel::rowCount(const QModelIndex
& parent
) const
36 return static_cast<int>(words
.size());
39 QVariant
ListModel::data(const QModelIndex
&index
, int role
) const {
40 if(!index
.isValid() || role
!= Qt::DisplayRole
)
43 return QVariant(words
[index
.row()]);