|
OpenHantek
|
#include <QtAwesome.h>
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. | |
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
| 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) )
| void QtAwesome::give | ( | const QString & | name, |
| QtAwesomeIconPainter * | painter | ||
| ) |
| QIcon QtAwesome::icon | ( | int | character, |
| const QVariantMap & | options = QVariantMap() |
||
| ) |
Creates an icon with the given code-point awesome->icon( icon_group )
| 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
| name | the name of the icon |
| options | extra option to pass to the icon renderer |
| 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.
| painter | a dynamic painter that is going to paint the icon |
| optionmap | the options to pass to the painter |
| 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
1.8.14