Resource
#include <Resource.h>
Public Slots | |
QString | filename () const |
QImage | image () const |
QString | name () const |
void | setImage (QImage image) |
void | setName (QString value) |
QString | type () const |
Detailed Description
A Resource represents a gradient, pattern, brush tip, brush preset, palette or workspace definition.
Resources are identified by their type, name and filename. If you want to change the contents of a resource, you should read its data using data(), parse it and write the changed contents back.
Definition at line 30 of file Resource.h.
Constructor & Destructor Documentation
◆ Resource() [1/3]
Resource::Resource | ( | int | resourceId, |
const QString & | type, | ||
const QString & | name, | ||
const QString & | filename, | ||
const QImage & | image, | ||
QObject * | parent = 0 ) |
Definition at line 29 of file Resource.cpp.
◆ Resource() [2/3]
Resource::Resource | ( | KoResourceSP | resource, |
const QString & | type, | ||
QObject * | parent = 0 ) |
Definition at line 40 of file Resource.cpp.
◆ ~Resource()
|
override |
Definition at line 51 of file Resource.cpp.
◆ Resource() [3/3]
Definition at line 55 of file Resource.cpp.
Member Function Documentation
◆ filename
|
slot |
The filename of the resource, if present.
Not all resources are loaded from files.
Definition at line 101 of file Resource.cpp.
◆ image
|
slot |
An image that can be used to represent the resource in the user interface.
For some resources, like patterns, the image is identical to the resource, for others it's a mere icon.
Definition at line 107 of file Resource.cpp.
◆ name
|
slot |
The user-visible name of the resource.
Definition at line 91 of file Resource.cpp.
◆ operator!=()
Definition at line 71 of file Resource.cpp.
◆ operator=()
Resource Resource::operator= | ( | const Resource & | rhs | ) |
Definition at line 76 of file Resource.cpp.
◆ operator==()
bool Resource::operator== | ( | const Resource & | other | ) | const |
Definition at line 66 of file Resource.cpp.
◆ setImage
Change the image for this resource.
Definition at line 112 of file Resource.cpp.
◆ setName
setName changes the user-visible name of the current resource.
Definition at line 96 of file Resource.cpp.
◆ type
|
slot |
Return the type of this resource.
Valid types are:
- pattern: a raster image representing a pattern
- gradient: a gradient
- brush: a brush tip
- preset: a brush preset
- palette: a color set
- workspace: a workspace definition.
Definition at line 86 of file Resource.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:53 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.