-
Notifications
You must be signed in to change notification settings - Fork 4
/
palettemodel.h
42 lines (30 loc) · 983 Bytes
/
palettemodel.h
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
36
37
38
39
40
41
42
#ifndef _PALETTEMODEL_H_
#define _PALETTEMODEL_H_
#include <QAbstractItemModel>
#include <QVector>
class Color;
class ColorManager;
class PaletteModel : public QAbstractItemModel
{
Q_OBJECT;
public:
PaletteModel(QObject *parent = NULL);
~PaletteModel();
void setColorManager(ColorManager *cm);
int columnCount(const QModelIndex &parent = QModelIndex()) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QVariant data(const QModelIndex &index, int role) const;
public slots:
void resetModel();
private slots:
void colorAppended();
void colorInserted(int before);
void colorDeleted(int index);
void colorSwapped(int index1, int index2);
private:
const QVector<const Color *> *list_;
};
#endif