summaryrefslogtreecommitdiff
path: root/src/dic-options/PackFieldsListModel.h
blob: 06565c5adf07b648d0f255a1f44f34737d30e72e (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
#ifndef PACKFIELDSLISTMODEL_H
#define PACKFIELDSLISTMODEL_H

#include <QAbstractListModel>

#include "DictionaryOptionsDialog.h"
#include "DraggableListModel.h"
#include "../dictionary/Dictionary.h"

class PackFieldsListModel : public DraggableListModel
{
    Q_OBJECT

public:
    PackFieldsListModel( DictionaryOptionsDialog* aParent ):
        DraggableListModel( aParent ), m_parentRow( 0 )
        {}

    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 );

public slots:
    void changeParentRow( const QModelIndex& aIndex );

private:
    int m_parentRow;
};

#endif