swift
Public Member Functions | Static Public Member Functions | List of all members
swift::misc::CIcon Class Reference

Value object for icons. An icon is stored in the global icon repository and identified by its index. It contains no(!) pyhsical data for the icon itself. More...

Inheritance diagram for swift::misc::CIcon:
[legend]

Public Member Functions

 CIcon ()
 Default constructor.
 
 CIcon (CIcons::IconIndex index)
 Constructor.
 
const QString & getDescriptiveText () const
 Constructor for generated icon. More...
 
const QString & getFileResourcePath () const
 Resource path if any.
 
bool hasFileResourcePath () const
 Resource path available?
 
CIcons::IconIndex getIndex () const
 Index.
 
bool isIndexBased () const
 Index based.
 
bool isGenerated () const
 Generated icon.
 
bool isFileBased () const
 File based?
 
bool isSet () const
 Icon set?
 
QPixmap toPixmap () const
 Corresponding pixmap.
 
CIcons::IconIndex toIcon () const
 Identity function.
 
QIcon toQIcon () const
 A QIcon.
 
void setRotation (int degrees)
 Rotate by n degrees.
 
void setDescriptiveText (const QString &text)
 Set descriptive text.
 
 operator QPixmap () const
 Implicit conversion.
 
QString convertToQString (bool i18n=false) const
 Cast as QString. More...
 
- Public Member Functions inherited from swift::misc::mixin::MetaType< CIcon >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object. More...
 
QString getClassName () const
 Class name.
 
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
 
- Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CIcon >
void marshallToDbus (QDBusArgument &arg, Tags...) const
 Marshall without begin/endStructure, for when composed within another object.
 
void unmarshallFromDbus (const QDBusArgument &arg, Tags...)
 Unmarshall without begin/endStructure, for when composed within another object.
 
- Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CIcon >
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
 
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
 
- Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CIcon >
QJsonObject toJson () const
 Cast to JSON object.
 
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const
 Convenience function JSON as string.
 
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
 
void convertFromJson (const QString &jsonString, bool acceptCacheFormat=false)
 Assign from JSON object string.
 
- Public Member Functions inherited from swift::misc::mixin::String< CIcon >
QString toQString (bool i18n=false) const
 Cast as QString.
 
std::string toStdString (bool i18n=false) const
 To std string.
 
QString stringForStreaming () const
 String for streaming operators.
 

Static Public Member Functions

static const CIconiconByIndex (CIcons::IconIndex index)
 Icon for given index.
 
static const CIconiconByIndex (int index)
 Icon for given index.
 
static const CSequence< CIcon > & allIcons ()
 All icons.
 
- Static Public Member Functions inherited from swift::misc::mixin::MetaType< CIcon >
static void registerMetadata ()
 Register metadata.
 
- Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CIcon >
static DerivedObj fromJson (const QJsonObject &json)
 Get object from QJsonObject.
 
static DerivedObj fromJson (const QString &jsonString, bool acceptCacheJson=false)
 Get object from JSON string.
 
static DerivedObj fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg)
 Get object from JSON string.
 

Detailed Description

Value object for icons. An icon is stored in the global icon repository and identified by its index. It contains no(!) pyhsical data for the icon itself.

Definition at line 29 of file icon.h.

Member Function Documentation

◆ convertToQString()

QString swift::misc::CIcon::convertToQString ( bool  i18n = false) const

Cast as QString.

Definition at line 47 of file icon.cpp.

◆ getDescriptiveText()

const QString& swift::misc::CIcon::getDescriptiveText ( ) const
inline

Constructor for generated icon.

Constructor for file icons Get descriptive text

Definition at line 54 of file icon.h.


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