Copyright 2010 Comarch S.A.
*******************************************************************************/
-
-//Created by Mateusz Półrola
+/*!
+ \file DictsModel.h
+ \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+*/
#ifndef DICTSMODEL_H
#define DICTSMODEL_H
#include <QAbstractItemModel>
#include "DownloadDict.h"
+
+/*!
+ Item model for informations about xdxf dictionaries.
+ Contains informations about languages of dictionary, it's name, size and
+ download link. Download link is stored as UserRole, and not displayed in views
+ using this model.
+*/
class DictsModel : public QAbstractItemModel
{
Q_OBJECT
public:
+ /*!
+ Constructor
+ \param dicts list of DownloadDict objects, each such object describes
+ one dictionary
+ */
DictsModel(QList<DownloadDict> dicts, QObject *parent);
+ //! \return return numner of rows
int rowCount(const QModelIndex &parent = QModelIndex()) const;
+
+ //! \return return numner of columns
int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ //! create Index, createIndex(row,column,row)
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+
+ //! return new QModelIndex;
QModelIndex parent(const QModelIndex &child) const;
+ /*!
+ \return return empty QVariant when role is't DisplayRole,
+ else return QVariant (QString with _from,_to,_title)
+ */
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- QVariant headerData(int section, Qt::Orientation orientation, int role) const;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
+ //! \return return a QVariant with header QString.
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const;
private:
QList<DownloadDict> dicts;