Qt ForkAwesome 0.2.2
Library that bundles ForkAwesome for use within Qt applications
Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
1#include "./utils.h"
2#include "./icon.h"
3
4#include <QHash>
5#include <QString>
6
7namespace QtForkAwesome {
8
15Icon iconFromId(const QString &id)
16{
17 static const auto mapping = QHash<QString, Icon>({
18#include "private/idmapping.h"
19 });
20 const auto icon = mapping.find(id);
21 return icon != mapping.cend() ? *icon : Icon::Invalid;
22}
23
24} // namespace QtForkAwesome
Contains classes provided by the QtForkAwesome library.
Definition renderer.h:20
Icon
The Icon enum specifies a ForkAwesome icon for calling QtForkAwesome::Renderer::render().
Definition icon.h:11
QT_FORK_AWESOME_EXPORT Icon iconFromId(const QString &id)
Returns a QtForkAwesome::Icon for the specified icon id.
Definition utils.cpp:15