explicit WordListModel(QObject *parent = 0);
int rowCount(const QModelIndex & parent = QModelIndex()) const;
+ void setBookmarkModeActive(bool mode);
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
//! Clear model data and refresh UI
void clear();
+ QString wordOnPosition(int index);
+
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
signals:
*/
void setModelProperty(int index, const QVariant value, QString role);
+ //! Reverse value at role in index row of data.
+ /*!
+ \param index word position in data list
+ \param role role name
+ */
+ void setModelPropertyByIndex(int index, QString role);
+
private:
int setDataPriv(int index, const QVariant &value, int role);
void addWord(QString word, QList<Translation*> translations, bool isBookmarked);
QHash<QString, bool > _wordInBookmarks;
QList<QString> _wordList;
+ bool _isBookmarkModeActive;
+
};
#endif // WORDLISTMODEL_H