Qt ForkAwesome 0.2.3
Library that bundles ForkAwesome for use within Qt applications
|
Allows rendering a QtForkAwesome::Icon (or an arbitrary QChar using an arbitrary font file). More...
#include <renderer.h>
Public Member Functions | |
Renderer (const QString &fontFileName=QString()) | |
Constructs a new renderer with the given fontFileName. | |
Renderer (const QByteArray &fontData) | |
Constructs a new renderer with the given fontData. | |
~Renderer () | |
Destructs the renderer. | |
operator bool () const | |
Returns whether the render could be initialized correctly. | |
void | render (QChar character, QPainter *painter, const QRect &rect, const QColor &color) const |
void | render (Icon icon, QPainter *painter, const QRect &rect, const QColor &color) const |
Renders the specified icon using the specified painter. | |
QPixmap | pixmap (QChar icon, const QSize &size, const QColor &color, qreal scaleFactor) const |
Renders the specified character as pixmap of the specified size. | |
QPixmap | pixmap (Icon icon, const QSize &size, const QColor &color, qreal scaleFactor) const |
Renders the specified icon as pixmap of the specified size. | |
QPixmap | pixmap (QChar icon, const QSize &size, const QColor &color) const |
QPixmap | pixmap (Icon icon, const QSize &size, const QColor &color) const |
Renders the specified icon as pixmap of the specified size. | |
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 | addThemeOverride (Icon icon, const QString &iconNameInTheme) |
Uses the icon from the current icon theme obtained via QIcon::fromTheme() for icon if it exists. | |
void | addOverride (QChar character, const QIcon &override) |
Uses the specified override icon for character if it is not null. | |
void | addOverride (Icon icon, const QIcon &override) |
Uses the specified override icon for icon if it is not null. | |
void | setAssociatedPaintDevice (QPaintDevice *paintDevice) |
Sets the associated paintDevice. | |
void | clearOverrides () |
Clears all overrides added via addThemeOverride() or addOverride(). | |
Static Public Member Functions | |
static Renderer & | global () |
Returns the global instance (which is so far only used by the icon engine plugin). | |
Allows rendering a QtForkAwesome::Icon (or an arbitrary QChar using an arbitrary font file).
|
explicit |
Constructs a new renderer with the given fontFileName.
Definition at line 86 of file renderer.cpp.
|
explicit |
Constructs a new renderer with the given fontData.
Definition at line 95 of file renderer.cpp.
QtForkAwesome::Renderer::~Renderer | ( | ) |
Destructs the renderer.
Definition at line 103 of file renderer.cpp.
|
inline |
Uses the specified override icon for icon if it is not null.
Definition at line 71 of file renderer.h.
void QtForkAwesome::Renderer::addOverride | ( | QChar | character, |
const QIcon & | override ) |
Uses the specified override icon for character if it is not null.
Definition at line 223 of file renderer.cpp.
|
inline |
Uses the icon from the current icon theme obtained via QIcon::fromTheme() for icon if it exists.
Definition at line 63 of file renderer.h.
void QtForkAwesome::Renderer::addThemeOverride | ( | QChar | character, |
const QString & | iconNameInTheme ) |
Uses the icon from the current icon theme obtained via QIcon::fromTheme() for character if it exists.
Definition at line 215 of file renderer.cpp.
void QtForkAwesome::Renderer::clearOverrides | ( | ) |
Clears all overrides added via addThemeOverride() or addOverride().
Definition at line 231 of file renderer.cpp.
|
static |
Returns the global instance (which is so far only used by the icon engine plugin).
Definition at line 250 of file renderer.cpp.
QtForkAwesome::Renderer::operator bool | ( | ) | const |
Returns whether the render could be initialized correctly.
Definition at line 113 of file renderer.cpp.
QPixmap QtForkAwesome::Renderer::pixmap | ( | Icon | icon, |
const QSize & | size, | ||
const QColor & | color ) const |
Renders the specified icon as pixmap of the specified size.
Definition at line 207 of file renderer.cpp.
QPixmap QtForkAwesome::Renderer::pixmap | ( | Icon | icon, |
const QSize & | size, | ||
const QColor & | color, | ||
qreal | scaleFactor ) const |
Renders the specified icon as pixmap of the specified size.
Definition at line 181 of file renderer.cpp.
QPixmap QtForkAwesome::Renderer::pixmap | ( | QChar | icon, |
const QSize & | size, | ||
const QColor & | color ) const |
QPixmap QtForkAwesome::Renderer::pixmap | ( | QChar | icon, |
const QSize & | size, | ||
const QColor & | color, | ||
qreal | scaleFactor ) const |
Renders the specified character as pixmap of the specified size.
Definition at line 149 of file renderer.cpp.
|
inline |
Renders the specified icon using the specified painter.
Definition at line 55 of file renderer.h.
void QtForkAwesome::Renderer::render | ( | QChar | character, |
QPainter * | painter, | ||
const QRect & | rect, | ||
const QColor & | color ) const |
void QtForkAwesome::Renderer::setAssociatedPaintDevice | ( | QPaintDevice * | paintDevice | ) |
Sets the associated paintDevice.
Definition at line 242 of file renderer.cpp.