summaryrefslogtreecommitdiff
path: root/src/dic-options/UnusedFieldsListModel.h
blob: c3a95f66549e617e32c10aa3ff409e9ef9093e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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