-
Notifications
You must be signed in to change notification settings - Fork 290
/
Copy pathqtrcloader.h
60 lines (50 loc) · 1.26 KB
/
qtrcloader.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
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef QT_RCLOADER_H
#define QT_RCLOADER_H
#define FOREACH_ICON(F) \
F(RC_SUBMIT, "submit.png") \
F(RC_CLOSE, "close.png") \
\
F(RC_START, "start.png") \
F(RC_PAUSE, "pause.png") \
F(RC_STOP, "stop.png") \
\
F(RC_ADD, "add.png") \
F(RC_DEL, "del.png") \
F(RC_TRASH, "trash.png") \
#define FOREACH_ICON_MV(F) \
F(RC_STYLE1, "style1.png") \
F(RC_STYLE2, "style2.png") \
F(RC_STYLE4, "style4.png") \
F(RC_STYLE9, "style9.png") \
F(RC_STYLE16, "style16.png") \
F(RC_STYLE25, "style25.png") \
F(RC_STYLE36, "style36.png") \
F(RC_STYLE49, "style49.png") \
F(RC_STYLE64, "style64.png") \
#define FOREACH_RC(F) \
FOREACH_ICON(F) \
FOREACH_ICON_MV(F) \
#define ENUM_RCID(rcid, _) rcid,
enum RCID {
RC_FIRST = 1,
FOREACH_RC(ENUM_RCID)
RC_LAST
};
#include "singleton.h"
#include <QMap>
#include <QPixmap>
class HRcLoader
{
SINGLETON_DECL(HRcLoader)
private:
HRcLoader() {}
public:
void loadIcon();
QPixmap get(RCID rcid) {
return m_mapIcon[rcid];
}
private:
QMap<RCID, QPixmap> m_mapIcon;
};
#define rcloader HRcLoader::instance()
#endif // QT_RCLOADER_H