1#ifndef QT_FORK_AWESOME_RENDERER
2#define QT_FORK_AWESOME_RENDERER
11QT_FORWARD_DECLARE_CLASS(QByteArray)
12QT_FORWARD_DECLARE_CLASS(QColor)
13QT_FORWARD_DECLARE_CLASS(QPainter)
14QT_FORWARD_DECLARE_CLASS(QRect)
15QT_FORWARD_DECLARE_CLASS(QSize)
16QT_FORWARD_DECLARE_CLASS(QPixmap)
17QT_FORWARD_DECLARE_CLASS(QIcon)
25 explicit Renderer(
const QString &fontFileName = QString());
26 explicit Renderer(
const QByteArray &fontData);
29 operator bool()
const;
30 void render(QChar character, QPainter *painter,
const QRect &rect,
const QColor &color)
const;
31 void render(
Icon icon, QPainter *painter,
const QRect &rect,
const QColor &color)
const;
33 QPixmap pixmap(QChar icon,
const QSize &size,
const QColor &color)
const;
34 QPixmap pixmap(
Icon icon,
const QSize &size,
const QColor &color)
const;
36 void addThemeOverride(QChar character,
const QString &iconNameInTheme);
37 void addThemeOverride(
Icon icon,
const QString &iconNameInTheme);
38 void addOverride(QChar character,
const QIcon &
override);
39 void addOverride(
Icon icon,
const QIcon &
override);
40 void clearOverrides();
45 std::unique_ptr<Renderer::InternalData> m_d;
51inline void Renderer::render(
Icon icon, QPainter *painter,
const QRect &rect,
const QColor &color)
const
53 render(QChar(
static_cast<IconBaseType>(icon)), painter, rect, color);
59inline void Renderer::addThemeOverride(
Icon icon,
const QString &iconNameInTheme)
61 addThemeOverride(QChar(
static_cast<IconBaseType>(icon)), iconNameInTheme);
67inline void Renderer::addOverride(
Icon icon,
const QIcon &
override)
69 addOverride(QChar(
static_cast<IconBaseType>(icon)),
override);
Allows rendering a QtForkAwesome::Icon (or an arbitrary QChar using an arbitrary font file).
#define QT_FORK_AWESOME_EXPORT
Marks the symbol to be exported by the qtforkawesome library.
Contains classes provided by the QtForkAwesome library.
Icon
The Icon enum specifies a ForkAwesome icon for calling QtForkAwesome::Renderer::render().
std::remove_reference_t< decltype(QChar().unicode())> IconBaseType