KSvg::ImageSet
#include <KSvg/ImageSet>
Properties | |
QString | basePath |
QString | imageSetName |
bool | useGlobalSettings |
Properties inherited from QObject | |
objectName | |
Signals | |
void | basePathChanged (const QString &basePath) |
void | imageSetChanged (const QString &basePath) |
Public Member Functions | |
ImageSet (const QString &imageSetName, const QString &basePath={}, QObject *parent=nullptr) | |
ImageSet (QObject *parent=nullptr) | |
QString | basePath () const |
bool | currentImageSetHasImage (const QString &name) const |
QString | filePath (const QString &name) const |
QString | imagePath (const QString &name) const |
QString | imageSetName () const |
KPluginMetaData | metadata () const |
QStringList | selectors () const |
void | setBasePath (const QString &basePath) |
void | setCacheLimit (int kbytes) |
void | setImageSetName (const QString &imageSetName) |
void | setSelectors (const QStringList &selectors) |
void | setUseGlobalSettings (bool useGlobal) |
bool | useGlobalSettings () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
Interface to the Svg image set.
KSvg::ImageSet provides access to a common and standardized set of graphic elements stored in SVG format. This allows artists to create single packages of SVGs that will affect the look and feel of all workspace components.
KSvg::Svg uses KSvg::ImageSet internally to locate and load the appropriate SVG data. Alternatively, KSvg::ImageSet can be used directly to retrieve file system paths to SVGs by name.
Definition at line 40 of file imageset.h.
Property Documentation
◆ basePath
|
readwrite |
Definition at line 45 of file imageset.h.
◆ imageSetName
|
readwrite |
Definition at line 44 of file imageset.h.
◆ useGlobalSettings
|
read |
Definition at line 46 of file imageset.h.
Constructor & Destructor Documentation
◆ ImageSet() [1/2]
|
explicit |
◆ ImageSet() [2/2]
|
explicit |
This method constructs a theme which will be a custom theme instance of imageSetName.
- Parameters
-
imageSetName the name of the theme to create basePath base path for the theme to look for svgs. if empty, the default will be used. parent the parent object
Definition at line 44 of file imageset.cpp.
◆ ~ImageSet()
|
override |
Definition at line 73 of file imageset.cpp.
Member Function Documentation
◆ basePath()
QString KSvg::ImageSet::basePath | ( | ) | const |
This method returns the base path of the theme where the SVGs will be looked for.
Definition at line 110 of file imageset.cpp.
◆ basePathChanged
|
signal |
This signal is emitted when the user changes the base path of the image set.
◆ currentImageSetHasImage()
bool KSvg::ImageSet::currentImageSetHasImage | ( | const QString & | name | ) | const |
This method checks whether this theme contains an image with the given name.
- Parameters
-
name the name of the file in the theme directory (without the ".svg" part or a leading slash)
- Returns
- true if the image exists for this theme
Definition at line 219 of file imageset.cpp.
◆ filePath()
This method returns the path for a generic file in the current theme.
The theme can also ship any generic file, such as configuration files.
- Parameters
-
name the name of the file in the theme directory (without a leading slash)
- Returns
- the full path to the requested file for the current theme
Definition at line 194 of file imageset.cpp.
◆ imagePath()
This method returns the path for an SVG image in the current theme.
- Parameters
-
name the name of the file in the theme directory (without the ".svg" part or a leading slash).
- Returns
- the full path to the requested file for the current theme
Definition at line 158 of file imageset.cpp.
◆ imageSetChanged
|
signal |
@brif This signal is emitted when the user makes changes to the theme.
Rendered images, colors, etc. should be updated at this point. However, SVGs should not be repainted in response to this signal; connect to Svg::repaintNeeded() instead for that, as SVG objects need repainting not only when imageSetChanged() is emitted; moreover SVG objects connect to and respond appropriately to imageSetChanged() internally, emitting Svg::repaintNeeded() at an appropriate time.
◆ imageSetName()
QString KSvg::ImageSet::imageSetName | ( | ) | const |
This method returns the name of the current theme.
Definition at line 153 of file imageset.cpp.
◆ metadata()
KPluginMetaData KSvg::ImageSet::metadata | ( | ) | const |
This method returns the plugin metadata for this theme.
Metadata contains information such as name, description, author, website, and url.
Definition at line 256 of file imageset.cpp.
◆ selectors()
QStringList KSvg::ImageSet::selectors | ( | ) | const |
This method returns the current selectors in order of preference.
Definition at line 121 of file imageset.cpp.
◆ setBasePath()
void KSvg::ImageSet::setBasePath | ( | const QString & | basePath | ) |
This method sets a base path for the theme to look for SVGs.
It can be a path relative to QStandardPaths::GenericDataLocation or an absolute path.
- Parameters
-
basePath the base path
Definition at line 89 of file imageset.cpp.
◆ setCacheLimit()
void KSvg::ImageSet::setCacheLimit | ( | int | kbytes | ) |
This method sets the maximum size of the cache (in kilobytes).
If cache gets bigger than the limit, then some entries are removed. Setting cache limit to 0 disables automatic cache size limiting.
Note that the cleanup might not be done immediately, so the cache might temporarily (for a few seconds) grow bigger than the limit.
Definition at line 249 of file imageset.cpp.
◆ setImageSetName()
void KSvg::ImageSet::setImageSetName | ( | const QString & | imageSetName | ) |
This method sets the current theme.
Definition at line 126 of file imageset.cpp.
◆ setSelectors()
void KSvg::ImageSet::setSelectors | ( | const QStringList & | selectors | ) |
This method sets the file selectors.
The theme can have different svgs with the same name for different situations and platforms. The Plasma desktop for instance uses "opaque" or "translucent" based on presence of compositing and KWin blur effects. Other uses may be platform, like android-specific graphics.
- Parameters
-
selectors selectors in order of preference
Definition at line 115 of file imageset.cpp.
◆ setUseGlobalSettings()
void KSvg::ImageSet::setUseGlobalSettings | ( | bool | useGlobal | ) |
This method sets whether the theme should follow the global settings or use application-specific settings.
- Parameters
-
useGlobal pass in true to follow the global settings
Definition at line 233 of file imageset.cpp.
◆ useGlobalSettings()
bool KSvg::ImageSet::useGlobalSettings | ( | ) | const |
This method returns whether the global settings are followed.
If application-specific settings are being used, it returns false
.
Definition at line 244 of file imageset.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:00:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.