TDE 0.1.0
 
Loading...
Searching...
No Matches
icon.hpp
Go to the documentation of this file.
1
12#pragma once
13
14#include <cstdint>
15#include <qicon.h>
16#include <qmap.h>
17#include <qpixmap.h>
18
19#include "tde/common.hpp"
20
21namespace tde::widgets {
22
27enum class IconType : uint8_t
28{
29 DEFAULT,
30 HELP_ABOUT,
31};
32
37class TDE_PUBLIC IconFactory
38{
39public:
40 inline static const QMap<IconType, QString> ICON_MAP = {
41 { IconType::DEFAULT, ":/tde/icons/default.svg" },
42 { IconType::HELP_ABOUT, ":/tde/icons/help-about.svg" },
43 };
51 static QIcon icon(IconType type);
52
59 static QIcon icon(const QString& path);
60
67 static QPixmap pixmap(IconType type);
68
76 static QPixmap pixmap(IconType type, const QSize& size);
77
84 static QPixmap pixmap(const QString& path);
85};
86
87}
Icon factory to load icons.
Definition icon.hpp:38
Some utility macros.
IconType
Embedded icon type.
Definition icon.hpp:28