Qt ForkAwesome 0.0.4
Library that bundles ForkAwesome for use within Qt applications
Public Member Functions | List of all members
QtForkAwesome::Renderer Class Reference

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. More...
 
 Renderer (const QByteArray &fontData)
 Constructs a new renderer with the given fontData. More...
 
 ~Renderer ()
 Destructs the renderer. More...
 
 operator bool () const
 Returns whether the render could be initialized correctly. More...
 
void render (QChar character, QPainter *painter, const QRect &rect, const QColor &color) const
 Renders the specified icon using the specified painter. More...
 
void render (Icon icon, QPainter *painter, const QRect &rect, const QColor &color) const
 Renders the specified icon using the specified painter. More...
 
QPixmap pixmap (QChar icon, const QSize &size, const QColor &color) const
 Renders the specified character as pixmap of the specified size. More...
 
QPixmap pixmap (Icon icon, const QSize &size, const QColor &color) const
 Renders the specified icon as pixmap of the specified size. More...
 

Detailed Description

Allows rendering a QtForkAwesome::Icon (or an arbitrary QChar using an arbitrary font file).

Definition at line 21 of file renderer.h.

Constructor & Destructor Documentation

◆ Renderer() [1/2]

QtForkAwesome::Renderer::Renderer ( const QString &  fontFileName = QString())
explicit

Constructs a new renderer with the given fontFileName.

Remarks
If fontFileName is empty, the bundled font file will be used.

Definition at line 40 of file renderer.cpp.

◆ Renderer() [2/2]

QtForkAwesome::Renderer::Renderer ( const QByteArray &  fontData)
explicit

Constructs a new renderer with the given fontData.

Definition at line 49 of file renderer.cpp.

◆ ~Renderer()

QtForkAwesome::Renderer::~Renderer ( )

Destructs the renderer.

Definition at line 57 of file renderer.cpp.

Member Function Documentation

◆ operator bool()

QtForkAwesome::Renderer::operator bool ( ) const

Returns whether the render could be initialized correctly.

Definition at line 67 of file renderer.cpp.

◆ pixmap() [1/2]

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 111 of file renderer.cpp.

◆ pixmap() [2/2]

QPixmap QtForkAwesome::Renderer::pixmap ( QChar  icon,
const QSize &  size,
const QColor &  color 
) const

Renders the specified character as pixmap of the specified size.

Definition at line 92 of file renderer.cpp.

◆ render() [1/2]

void QtForkAwesome::Renderer::render ( Icon  icon,
QPainter *  painter,
const QRect &  rect,
const QColor &  color 
) const
inline

Renders the specified icon using the specified painter.

Definition at line 43 of file renderer.h.

◆ render() [2/2]

void QtForkAwesome::Renderer::render ( QChar  character,
QPainter *  painter,
const QRect &  rect,
const QColor &  color 
) const

Renders the specified icon using the specified painter.

Definition at line 75 of file renderer.cpp.


The documentation for this class was generated from the following files: