Qt ForkAwesome
0.3.0
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
7
namespace
QtForkAwesome
{
8
15
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
16
Icon
iconFromId
(QStringView
id
)
17
#else
18
Icon
iconFromId
(
const
QString &
id
)
19
#endif
20
{
21
static
const
auto
mapping = QHash<QString, Icon>({
22
#include "private/idmapping.h"
23
});
24
const
auto
icon = mapping.find(
id
);
25
return
icon != mapping.cend() ? *icon :
Icon::Invalid
;
26
}
27
34
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
35
Icon
iconFromId
(
const
QString &
id
)
36
{
37
return
iconFromId
(QStringView(
id
));
38
}
39
#else
40
Icon
iconFromId
(QStringView
id
)
41
{
42
return
iconFromId
(
id
.toString());
43
}
44
#endif
45
46
47
}
// namespace QtForkAwesome
icon.h
QtForkAwesome
Contains classes provided by the QtForkAwesome library.
Definition
renderer.h:20
QtForkAwesome::Icon
Icon
The Icon enum specifies a ForkAwesome icon for calling QtForkAwesome::Renderer::render().
Definition
icon.h:11
QtForkAwesome::Icon::Invalid
@ Invalid
Definition
icon.h:12
QtForkAwesome::iconFromId
QT_FORK_AWESOME_EXPORT Icon iconFromId(const QString &id)
Returns a QtForkAwesome::Icon for the specified icon id.
Definition
utils.cpp:35
utils.h
Generated on Sat Feb 1 2025 19:15:22 for Qt ForkAwesome by
1.13.2