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(QPaintDevice)
17QT_FORWARD_DECLARE_CLASS(QPixmap)
18QT_FORWARD_DECLARE_CLASS(QIcon)
26 explicit Renderer(
const QString &fontFileName = QString());
27 explicit Renderer(
const QByteArray &fontData);
32 operator bool()
const;
33 void render(QChar character, QPainter *painter,
const QRect &rect,
const QColor &color)
const;
34 void render(
Icon icon, QPainter *painter,
const QRect &rect,
const QColor &color)
const;
36 QPixmap
pixmap(QChar icon,
const QSize &size,
const QColor &color, qreal scaleFactor)
const;
37 QPixmap
pixmap(
Icon icon,
const QSize &size,
const QColor &color, qreal scaleFactor)
const;
38 QPixmap
pixmap(QChar icon,
const QSize &size,
const QColor &color)
const;
39 QPixmap
pixmap(
Icon icon,
const QSize &size,
const QColor &color)
const;
43 void addOverride(QChar character,
const QIcon &
override);
51 std::unique_ptr<Renderer::InternalData> m_d;
Renderer(const QString &fontFileName=QString())
Constructs a new renderer with the given fontFileName.
static Renderer & global()
Returns the global instance (which is so far only used by the icon engine plugin).
const QString & fontFilePath() const
Returns the path of the font file.
void clearOverrides()
Clears all overrides added via addThemeOverride() or addOverride().
void addThemeOverride(QChar character, const QString &iconNameInTheme)
Uses the icon from the current icon theme obtained via QIcon::fromTheme() for character if it exists.
void warnIfInvalid() const
Prints a warning using qWarning() if no font could be loaded.
void addOverride(QChar character, const QIcon &override)
Uses the specified override icon for character if it is not null.
QPixmap pixmap(QChar icon, const QSize &size, const QColor &color, qreal scaleFactor) const
Renders the specified character as pixmap of the specified size.
void setAssociatedPaintDevice(QPaintDevice *paintDevice)
Sets the associated paintDevice.
void render(QChar character, QPainter *painter, const QRect &rect, const QColor &color) const
Renders the specified icon using the specified painter.
#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