From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/dic-options/FieldsPreviewModel.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/dic-options/FieldsPreviewModel.h (limited to 'src/dic-options/FieldsPreviewModel.h') diff --git a/src/dic-options/FieldsPreviewModel.h b/src/dic-options/FieldsPreviewModel.h new file mode 100644 index 0000000..38e1fe2 --- /dev/null +++ b/src/dic-options/FieldsPreviewModel.h @@ -0,0 +1,27 @@ +#ifndef FIELDSPREVIEWMODEL_H +#define FIELDSPREVIEWMODEL_H + +#include + +#include "DictionaryOptionsDialog.h" +#include "../dictionary/Dictionary.h" + +class FieldsPreviewModel : public QAbstractListModel +{ + Q_OBJECT + +public: + FieldsPreviewModel( DictionaryOptionsDialog* aParent ): + QAbstractListModel( aParent ), m_parent( aParent ) + {} + + int rowCount( const QModelIndex& /*parent*/ = QModelIndex() ) const + { return m_parent->m_dict.fieldsNum(); } + QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; + Qt::ItemFlags flags(const QModelIndex &/*index*/) const {return Qt::NoItemFlags;} + +private: + DictionaryOptionsDialog* m_parent; +}; + +#endif // FIELDSPREVIEWMODEL_H -- cgit