1 #ifndef DICTMANAGERMODEL_H
2 #define DICTMANAGERMODEL_H
4 #include <QAbstractListModel>
6 #include "../../include/GUIInterface.h"
9 Contains a list of installed dictionaries.
10 Data source for qml list view.
12 class DictManagerModel : public QAbstractListModel
18 NameRole = Qt::UserRole + 1,
26 \param dictionaries list of dictionaries
27 \param parent parent of this class.
29 explicit DictManagerModel(QHash<CommonDictInterface*, bool> dictionaries, QObject *parent = 0);
31 int rowCount(const QModelIndex & parent = QModelIndex()) const;
33 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
34 bool setData(const QModelIndex &index, const QVariant &value, int role);
36 Qt::ItemFlags flags(const QModelIndex &index) const;
37 void setDictionaries(QHash<CommonDictInterface*, bool> dictionaries);
38 QHash<CommonDictInterface*, bool> dictionaries();
39 QList<CommonDictInterface*> dictList();
44 void setModelProperty(int index, const QVariant value, QString role);
50 QHash<CommonDictInterface*, bool> _dictionaries;
51 QList<CommonDictInterface*> _dictList;
53 int setDataPriv(int index, const QVariant &value, int role);
54 void addDictionary(CommonDictInterface* dictionary, bool isActive);
57 #endif // DICTMANAGERMODEL_H