OpenHantek
Public Member Functions
QtAwesome Class Reference

#include <QtAwesome.h>

Inheritance diagram for QtAwesome:

Public Member Functions

 QtAwesome (QObject *parent=0)
 The default icon colors.
 
void init (const QString &fontname)
 initializes the QtAwesome icon factory with the given fontname
 
bool initFontAwesome ()
 
void addNamedCodepoint (const QString &name, int codePoint)
 
QHash< QString, int > namedCodePoints ()
 
void setDefaultOption (const QString &name, const QVariant &value)
 Sets a default option. These options are passed on to the icon painters.
 
QVariant defaultOption (const QString &name)
 Returns the default option for the given name.
 
QIcon icon (int character, const QVariantMap &options=QVariantMap())
 
QIcon icon (const QString &name, const QVariantMap &options=QVariantMap())
 
QIcon icon (QtAwesomeIconPainter *painter, const QVariantMap &optionMap=QVariantMap())
 
void give (const QString &name, QtAwesomeIconPainter *painter)
 
QFont font (int size)
 
QString fontName ()
 Returns the font-name that is used as icon-map.
 

Detailed Description

The main class for managing icons This class requires a 2-phase construction. You must first create the class and then initialize it via an init* method

Member Function Documentation

◆ font()

QFont QtAwesome::font ( int  size)

Creates/Gets the icon font with a given size in pixels. This can be usefull to use a label for displaying icons Example:

QLabel* label = new QLabel( QChar( icon_group ) ); label->setFont( awesome->font(16) )

◆ give()

void QtAwesome::give ( const QString &  name,
QtAwesomeIconPainter painter 
)

Adds a named icon-painter to the QtAwesome icon map As the name applies the ownership is passed over to QtAwesome

Parameters
namethe name of the icon
painterthe icon painter to add for this name

◆ icon() [1/3]

QIcon QtAwesome::icon ( int  character,
const QVariantMap &  options = QVariantMap() 
)

Creates an icon with the given code-point awesome->icon( icon_group )

◆ icon() [2/3]

QIcon QtAwesome::icon ( const QString &  name,
const QVariantMap &  options = QVariantMap() 
)

Creates an icon with the given name

You can use the icon names as defined on http://fortawesome.github.io/Font-Awesome/design.html withour the 'icon-' prefix

Parameters
namethe name of the icon
optionsextra option to pass to the icon renderer

◆ icon() [3/3]

QIcon QtAwesome::icon ( QtAwesomeIconPainter painter,
const QVariantMap &  optionMap = QVariantMap() 
)

Create a dynamic icon by simlpy supplying a painter object The ownership of the painter is NOT transfered.

Parameters
paintera dynamic painter that is going to paint the icon
optionmapthe options to pass to the painter

◆ initFontAwesome()

bool QtAwesome::initFontAwesome ( )

a specialized init function so font-awesome is loaded and initialized this method return true on success, it will return false if the fnot cannot be initialized To initialize QtAwesome with font-awesome you need to call this method


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