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/PacksListModel.h |
Diffstat (limited to 'src/dic-options/PacksListModel.h')
-rw-r--r-- | src/dic-options/PacksListModel.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/dic-options/PacksListModel.h b/src/dic-options/PacksListModel.h new file mode 100644 index 0000000..3523912 --- /dev/null +++ b/src/dic-options/PacksListModel.h @@ -0,0 +1,32 @@ +#ifndef PACKSLISTMODEL_H +#define PACKSLISTMODEL_H + +#include <QAbstractListModel> + +#include "DictionaryOptionsDialog.h" +#include "DraggableListModel.h" +#include "../dictionary/Dictionary.h" + +class PacksListModel : public DraggableListModel +{ + Q_OBJECT + +public: + PacksListModel( DictionaryOptionsDialog* aParent ): + DraggableListModel( aParent ) + {} + + int rowCount( const QModelIndex& /*parent*/ = QModelIndex() ) const + { return m_parent->m_dict.cardPacksNum(); } + + QVariant data( const QModelIndex &index, int role ) const; + bool setData(const QModelIndex& index, const QVariant& aValue, int role = Qt::EditRole ); + Qt::ItemFlags flags(const QModelIndex &index) const; + 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 ); + void removePack( int aPos ); +}; + +#endif |