7130
|
1 |
#ifndef COLORWIDGET_H
|
|
2 |
#define COLORWIDGET_H
|
|
3 |
|
|
4 |
#include <QWidget>
|
|
5 |
#include <QModelIndex>
|
|
6 |
|
|
7 |
namespace Ui {
|
|
8 |
class ColorWidget;
|
|
9 |
}
|
|
10 |
|
|
11 |
class QStandardItemModel;
|
|
12 |
|
|
13 |
class ColorWidget : public QWidget
|
|
14 |
{
|
|
15 |
Q_OBJECT
|
|
16 |
|
|
17 |
public:
|
|
18 |
explicit ColorWidget(QStandardItemModel *colorsModel, QWidget *parent = 0);
|
|
19 |
~ColorWidget();
|
|
20 |
|
|
21 |
void setColors(QStandardItemModel * colorsModel);
|
|
22 |
void setColor(int color);
|
|
23 |
int getColor();
|
|
24 |
|
|
25 |
signals:
|
|
26 |
void colorChanged(int color);
|
|
27 |
|
|
28 |
private:
|
|
29 |
int m_color;
|
|
30 |
QStandardItemModel * m_colorsModel;
|
|
31 |
|
|
32 |
private slots:
|
|
33 |
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
|
34 |
|
|
35 |
protected:
|
|
36 |
void mousePressEvent(QMouseEvent * event);
|
|
37 |
void wheelEvent(QWheelEvent * event);
|
|
38 |
};
|
|
39 |
|
|
40 |
#endif // COLORWIDGET_H
|