-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcolordatamodel.h
47 lines (35 loc) · 1.29 KB
/
colordatamodel.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
43
44
45
46
47
#ifndef COLORDATAMODEL_H
#define COLORDATAMODEL_H
#include "singletonbase.h"
#include <QAction>
#include <QString>
class ColorDataModel : public SingletonBase<ColorDataModel>
{
public:
ColorDataModel();
virtual ~ColorDataModel();
QColor getNextColor();
Qt::BrushStyle getPattern();
void setCurrentColor(const QString & color);
void setCurrentPattern(const Qt::BrushStyle & pattern);
QAction * getColorAction(QString color);
QAction * getPatternAction(QString pattern);
QVector<QString> getSupportedColors();
QVector<QString> getSupportedPatterns();
protected:
void createColorList();
void createPatternMap();
void createColorActions();
void createPatternActions();
void createPatternList();
private:
QVector<QString> mColorList;
QVector<Qt::BrushStyle> mPatternList;
QMap<QString, QAction *> mColorActions;
QMap<QString, QAction *> mPatternActions;
QMap<Qt::BrushStyle, QString> mPatternMap;
QColor mCurrentColor;
Qt::BrushStyle mCurrentPattern;
QList<QColor> mPenColors;
};
#endif // COLORDATAMODEL_H