Krita
7 #include <KoResource.h>
11 #include <KoPattern.h>
12 #include <KoAbstractGradient.h>
13 #include <kis_brush.h>
14 #include <kis_paintop_preset.h>
15 #include <KoColorSet.h>
16 #include <kis_workspace_resource.h>
17 #include <KisResourceLocator.h>
19 struct Resource::Private {
36 d->filename = filename;
40 Resource::Resource(KoResourceSP resource,
const QString &type,
QObject *parent)
44 d->id = resource->resourceId();
46 d->name = resource->name();
47 d->filename = resource->filename();
48 d->image = resource->image();
55 Resource::Resource(
const Resource &rhs)
60 d->type = rhs.d->type;
61 d->name = rhs.d->name;
62 d->filename = rhs.d->filename;
63 d->image = rhs.d->image;
66 bool Resource::operator==(
const Resource &other)
const
68 return (d->id == other.d->id);
71 bool Resource::operator!=(
const Resource &other)
const
73 return !(operator==(other));
117 KoResourceSP Resource::resource()
const
119 KoResourceSP res = KisResourceLocator::instance()->resourceForId(d->id);
QString filename() const
The filename of the resource, if present.
Type type(const QSqlDatabase &db)
A Resource represents a gradient, pattern, brush tip, brush preset, palette or workspace definition.
QString name() const
The user-visible name of the resource.
QString type() const
Return the type of this resource.
QImage image() const
An image that can be used to represent the resource in the user interface.
void setName(QString value)
setName changes the user-visible name of the current resource.
void setImage(QImage image)
Change the image for this resource.
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:58:42 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.