-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorCountModel.h
More file actions
33 lines (26 loc) · 975 Bytes
/
ColorCountModel.h
File metadata and controls
33 lines (26 loc) · 975 Bytes
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
#ifndef COLORCOUNTMODEL_H
#define COLORCOUNTMODEL_H
#include <QStandardItemModel>
#include "ColorCount.h"
class ColorCountModel : public QAbstractItemModel
{
Q_OBJECT
public:
ColorCountModel(QObject *parent = 0);
~ColorCountModel();
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(const QRgb& color) const;
QModelIndex parent(const QModelIndex &child) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QColor color(int row) const;
public slots:
void setColors(const QList<ColorCount>& colors);
private:
QList<ColorCount> m_colors;
};
#endif