diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/dic-options/UnusedFieldsListModel.h |
Diffstat (limited to 'src/dic-options/UnusedFieldsListModel.h')
-rw-r--r-- | src/dic-options/UnusedFieldsListModel.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dic-options/UnusedFieldsListModel.h b/src/dic-options/UnusedFieldsListModel.h new file mode 100644 index 0000000..c3a95f6 --- /dev/null +++ b/src/dic-options/UnusedFieldsListModel.h @@ -0,0 +1,35 @@ +#ifndef UNUSEDFIELDSLISTMODEL_H +#define UNUSEDFIELDSLISTMODEL_H + +#include <QAbstractListModel> + +#include "DictionaryOptionsDialog.h" +#include "DraggableListModel.h" + +class UnusedFieldsListModel : public DraggableListModel +{ + Q_OBJECT + +public: + UnusedFieldsListModel( DictionaryOptionsDialog* aParent ); + + int rowCount( const QModelIndex& /*parent*/ = QModelIndex() ) const; + QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; + bool setData(const QModelIndex& index, const QVariant& aValue, int role = Qt::EditRole ); + bool insertRows(int position, int rows, const QModelIndex &); + bool removeRows(int position, int rows, const QModelIndex &); + const void* dataPtr( const QModelIndex& aIndex ) const; + void insertPointer( int aPos, void* aData ); + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, + const QModelIndex &parent); + +public slots: + void changeParentRow( const QModelIndex& aIndex ); + void updateUnusedFields(); + +private: + int m_parentRow; + QList<const Field*> m_unusedFields; ///< Always updated list +}; + +#endif |