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/DraggableListModel.h |
Diffstat (limited to 'src/dic-options/DraggableListModel.h')
-rw-r--r-- | src/dic-options/DraggableListModel.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/dic-options/DraggableListModel.h b/src/dic-options/DraggableListModel.h new file mode 100644 index 0000000..e323def --- /dev/null +++ b/src/dic-options/DraggableListModel.h @@ -0,0 +1,33 @@ +#ifndef DRAGGABLELISTMODEL_H +#define DRAGGABLELISTMODEL_H + +#include <QAbstractListModel> + +#include "DictionaryOptionsDialog.h" +#include "../dictionary/Dictionary.h" + +class DraggableListModel : public QAbstractListModel +{ + Q_OBJECT + +public: + DraggableListModel( DictionaryOptionsDialog* aParent ): + QAbstractListModel( aParent ), m_parent( aParent ) + {} + + Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::DropActions supportedDropActions() const; + QStringList mimeTypes() const; + QMimeData * mimeData(const QModelIndexList &indexes) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); + virtual const void* dataPtr( const QModelIndex &aIndex ) const = 0; + virtual void insertPointer(int aPos, void *aData) = 0; + +signals: + void indexesDropped(QList<QPersistentModelIndex> aIndexes); + +protected: + DictionaryOptionsDialog* m_parent; +}; + +#endif |