Krita Source Code Documentation
Loading...
Searching...
No Matches
KisEraserModeResourceConverter Class Reference

#include <kis_derived_resources.h>

+ Inheritance diagram for KisEraserModeResourceConverter:

Public Member Functions

QVariant fromSource (const QVariant &value) override
 
 KisEraserModeResourceConverter ()
 
QVariant toSource (const QVariant &value, const QVariant &sourceValue) override
 
- Public Member Functions inherited from KoDerivedResourceConverter
int key () const
 
 KoDerivedResourceConverter (int key, int sourceKey)
 
virtual bool notifySourceChanged (const QVariant &sourceValue)
 
QVariant readFromSource (const QVariant &value)
 
int sourceKey () const
 
QVariant writeToSource (const QVariant &value, const QVariant &sourceValue, bool *changed)
 
virtual ~KoDerivedResourceConverter ()
 

Additional Inherited Members

Detailed Description

Definition at line 139 of file kis_derived_resources.h.

Constructor & Destructor Documentation

◆ KisEraserModeResourceConverter()

KisEraserModeResourceConverter::KisEraserModeResourceConverter ( )

Member Function Documentation

◆ fromSource()

QVariant KisEraserModeResourceConverter::fromSource ( const QVariant & value)
overridevirtual

Converts the value of the source resource into the space of the "derived" resource. E.g. preset -> opacity.

Implements KoDerivedResourceConverter.

Definition at line 389 of file kis_derived_resources.cpp.

390{
392 return preset ? preset->settings()->eraserMode() : QVariant();
393}
float value(const T *src, size_t ch)

References value().

◆ toSource()

QVariant KisEraserModeResourceConverter::toSource ( const QVariant & value,
const QVariant & sourceValue )
overridevirtual

Converts the value of the "derived" resource into the space of the original ("source") resource. E.g. opacity -> preset.

Implements KoDerivedResourceConverter.

Definition at line 395 of file kis_derived_resources.cpp.

396{
397 KisPaintOpPresetSP preset = sourceValue.value<KisPaintOpPresetSP>();
398 if (!preset) return sourceValue;
399
400 preset->settings()->setEraserMode(value.toBool());
401 return QVariant::fromValue(preset);
402}

References value().


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