KCountryFlagEmojiIconEngine
#include <kcountryflagemojiiconengine.h>
Public Member Functions | |
KCountryFlagEmojiIconEngine (const QString ®ionOrCountry) | |
QIconEngine * | clone () const override |
bool | isNull () override |
QString | key () const override |
void | paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override |
QPixmap | pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) override |
QPixmap | scaledPixmap (const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override |
Public Member Functions inherited from QIconEngine | |
virtual QSize | actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) |
virtual void | addFile (const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) |
virtual void | addPixmap (const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) |
virtual QList< QSize > | availableSizes (QIcon::Mode mode, QIcon::State state) |
virtual QString | iconName () |
virtual bool | read (QDataStream &in) |
virtual void | virtual_hook (int id, void *data) |
virtual bool | write (QDataStream &out) const const |
Static Public Member Functions | |
static void | setGlobalDefaultFont (const QFont &font) |
Additional Inherited Members | |
Public Types inherited from QIconEngine | |
enum | IconEngineHook |
Public Attributes inherited from QIconEngine | |
IsNullHook | |
ScaledPixmapHook | |
Detailed Description
Provides emoji flags as icons This is a special icon engine that internally paints flags using emoji fonts.
It provides access to country and region flags from the system emoji font.
- Since
- 6.0
Definition at line 24 of file kcountryflagemojiiconengine.h.
Constructor & Destructor Documentation
◆ KCountryFlagEmojiIconEngine()
|
explicit |
Construct a new KCountryFlagEmojiIconEngine object Please note that regional flag support can be spotty in emoji fonts.
- Parameters
-
regionOrCountry either a ISO 3166-1 alpha-2 country code or a ISO 3166-2 region code (e.g. AT for Austria or GB-SCT for Scotland)
Definition at line 91 of file kcountryflagemojiiconengine.cpp.
Member Function Documentation
◆ clone()
|
overridevirtual |
Implements QIconEngine.
Definition at line 98 of file kcountryflagemojiiconengine.cpp.
◆ isNull()
|
overridevirtual |
Check whether the internal emoji unicode sequence is null This does not necessarily mean that the pixmap output will be a valid flag - that entirely depends on the system's precise font configuration.
- Returns
- true when the construction of the emoji string failed
- false when the construction of the emoji string succeeded
Reimplemented from QIconEngine.
Definition at line 159 of file kcountryflagemojiiconengine.cpp.
◆ key()
|
overridevirtual |
Reimplemented from QIconEngine.
Definition at line 103 of file kcountryflagemojiiconengine.cpp.
◆ paint()
|
overridevirtual |
Implements QIconEngine.
Definition at line 108 of file kcountryflagemojiiconengine.cpp.
◆ pixmap()
|
overridevirtual |
Reimplemented from QIconEngine.
Definition at line 142 of file kcountryflagemojiiconengine.cpp.
◆ scaledPixmap()
|
overridevirtual |
Reimplemented from QIconEngine.
Definition at line 147 of file kcountryflagemojiiconengine.cpp.
◆ setGlobalDefaultFont()
|
static |
Set the Global Default Font object This is primarily useful for platform themes that wish to force a specific font being used.
By default the "emoji" font family will be used. Forcing a specific font and making sure it is available as runtime requirement is the most reliable way to ensure that flag support is working regardless of system configuration.
- Parameters
-
font the default font to use
Definition at line 164 of file kcountryflagemojiiconengine.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.