--- /dev/null
+#ifndef DICTSLISTMODEL_H
+#define DICTSLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QDebug>
+#include "DownloadDict.h"
+
+
+class DictsListModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ enum DictTypeRoles {
+ NumberRole=Qt::UserRole + 1,
+ FromRole,
+ ToRole,
+ NameRole,
+ SizeRole,
+ LinkRole
+ };
+ explicit DictsListModel(QList<DownloadDict> dicts, QObject *parent = 0);
+ int rowCount(const QModelIndex &) const;
+ QVariant data(const QModelIndex & index, int role) const;
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ DownloadDict currentDict();
+ QList<DownloadDict> dictionaries();
+
+public Q_SLOTS:
+ void itemSelected(int index);
+
+
+private:
+ QList<DownloadDict> dicts;
+ int _currentIndex;
+};
+
+#endif // DICTSLISTMODEL_H