Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSliderBasedPaintOpProperty< T > Class Template Reference

#include <kis_slider_based_paintop_property.h>

+ Inheritance diagram for KisSliderBasedPaintOpProperty< T >:

Public Member Functions

int decimals () const
 
qreal exponentRatio () const
 
 KisSliderBasedPaintOpProperty (const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisSliderBasedPaintOpProperty (Type type, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisSliderBasedPaintOpProperty (Type type, SubType subType, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
max () const
 
min () const
 
pageStep () const
 
void setDecimals (int value)
 
void setExponentRatio (qreal value)
 
void setPageStep (T value)
 
void setRange (T min, T max)
 
void setSingleStep (T value)
 
void setSuffix (QString value)
 
singleStep () const
 
QString suffix () const
 
- Public Member Functions inherited from KisSliderBasedPaintOpPropertyBase
 KisUniformPaintOpProperty (const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisUniformPaintOpProperty (Type type, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisUniformPaintOpProperty (Type type, SubType subType, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
- Public Member Functions inherited from KisUniformPaintOpProperty
QWidget * createPropertyWidget ()
 
QString id () const
 
virtual bool isVisible () const
 
 KisUniformPaintOpProperty (const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisUniformPaintOpProperty (Type type, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
 KisUniformPaintOpProperty (Type type, SubType subType, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
 
QString name () const
 
KisPaintOpSettingsSP settings () const
 
SubType subType () const
 
Type type () const
 
QVariant value () const
 
 ~KisUniformPaintOpProperty () override
 

Private Attributes

int m_decimals
 
qreal m_exponentRatio
 
m_max
 
m_min
 
m_pageStep
 
m_singleStep
 
QString m_suffix
 

Additional Inherited Members

- Public Types inherited from KisUniformPaintOpProperty
enum  SubType { SubType_None = 0 , SubType_Angle }
 Hint to guess what this property is used for. More...
 
enum  Type { Int = 0 , Double , Bool , Combo }
 
- Public Slots inherited from KisUniformPaintOpProperty
void requestReadValue ()
 
void setValue (const QVariant &value)
 
- Signals inherited from KisSliderBasedPaintOpPropertyBase
void sigRangeChanged ()
 
- Signals inherited from KisUniformPaintOpProperty
void valueChanged (const QVariant &value)
 
- Protected Member Functions inherited from KisUniformPaintOpProperty
virtual void readValueImpl ()
 
virtual void writeValueImpl ()
 

Detailed Description

template<typename T>
class KisSliderBasedPaintOpProperty< T >

This is a general class for the properties that can be represented in the GUI as an integer or double slider. The GUI representation creates a slider and connects it to this property using all the information contained in it.

Methods of this property basically copy the methods of Kis{,Double}SliderSpinbox

Definition at line 36 of file kis_slider_based_paintop_property.h.

Constructor & Destructor Documentation

◆ KisSliderBasedPaintOpProperty() [1/3]

◆ KisSliderBasedPaintOpProperty() [2/3]

template<typename T >
KisSliderBasedPaintOpProperty< T >::KisSliderBasedPaintOpProperty ( Type type,
const KoID & id,
KisPaintOpSettingsRestrictedSP settings,
QObject * parent )

Definition at line 28 of file kis_slider_based_paintop_property.cpp.

30 , m_min(T(0))
31 , m_max(T(100))
32 , m_singleStep(T(1))
33 , m_pageStep(T(10))
34 , m_exponentRatio(1.0)
35 , m_decimals(2)
36{
37}

◆ KisSliderBasedPaintOpProperty() [3/3]

template<typename T >
KisSliderBasedPaintOpProperty< T >::KisSliderBasedPaintOpProperty ( const KoID & id,
KisPaintOpSettingsRestrictedSP settings,
QObject * parent )

Definition at line 40 of file kis_slider_based_paintop_property.cpp.

42 , m_min(T(0))
43 , m_max(T(100))
44 , m_singleStep(T(1))
45 , m_pageStep(T(10))
46 , m_exponentRatio(1.0)
47 , m_decimals(2)
48{
49 qFatal("Should have never been called!");
50}

Member Function Documentation

◆ decimals()

template<typename T >
int KisSliderBasedPaintOpProperty< T >::decimals ( ) const

Definition at line 114 of file kis_slider_based_paintop_property.cpp.

115{
116 return m_decimals;
117}

◆ exponentRatio()

template<typename T >
qreal KisSliderBasedPaintOpProperty< T >::exponentRatio ( ) const

Definition at line 102 of file kis_slider_based_paintop_property.cpp.

103{
104 return m_exponentRatio;
105}

◆ max()

template<typename T >
T KisSliderBasedPaintOpProperty< T >::max ( ) const

Definition at line 59 of file kis_slider_based_paintop_property.cpp.

60{
61 return m_max;
62}

◆ min()

template<typename T >
T KisSliderBasedPaintOpProperty< T >::min ( ) const

Definition at line 53 of file kis_slider_based_paintop_property.cpp.

54{
55 return m_min;
56}

◆ pageStep()

template<typename T >
T KisSliderBasedPaintOpProperty< T >::pageStep ( ) const

Definition at line 90 of file kis_slider_based_paintop_property.cpp.

91{
92 return m_pageStep;
93}

◆ setDecimals()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setDecimals ( int value)

Definition at line 120 of file kis_slider_based_paintop_property.cpp.

References value().

◆ setExponentRatio()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setExponentRatio ( qreal value)

Definition at line 108 of file kis_slider_based_paintop_property.cpp.

109{
111}

References value().

◆ setPageStep()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setPageStep ( T value)

Definition at line 96 of file kis_slider_based_paintop_property.cpp.

97{
99}

References value().

◆ setRange()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setRange ( T min,
T max )

Definition at line 65 of file kis_slider_based_paintop_property.cpp.

66{
67 const bool valueChanged = m_min != min || m_max != max;
68
69 m_min = min;
70 m_max = max;
71
72 if (valueChanged) {
73 Q_EMIT sigRangeChanged();
74 }
75}
void valueChanged(const QVariant &value)

◆ setSingleStep()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setSingleStep ( T value)

Definition at line 84 of file kis_slider_based_paintop_property.cpp.

85{
87}

References value().

◆ setSuffix()

template<typename T >
void KisSliderBasedPaintOpProperty< T >::setSuffix ( QString value)

◆ singleStep()

template<typename T >
T KisSliderBasedPaintOpProperty< T >::singleStep ( ) const

Definition at line 78 of file kis_slider_based_paintop_property.cpp.

79{
80 return m_singleStep;
81}

◆ suffix()

template<typename T >
QString KisSliderBasedPaintOpProperty< T >::suffix ( ) const

Definition at line 126 of file kis_slider_based_paintop_property.cpp.

127{
128 return m_suffix;
129}

Member Data Documentation

◆ m_decimals

template<typename T >
int KisSliderBasedPaintOpProperty< T >::m_decimals
private

Definition at line 71 of file kis_slider_based_paintop_property.h.

◆ m_exponentRatio

template<typename T >
qreal KisSliderBasedPaintOpProperty< T >::m_exponentRatio
private

Definition at line 69 of file kis_slider_based_paintop_property.h.

◆ m_max

template<typename T >
T KisSliderBasedPaintOpProperty< T >::m_max
private

Definition at line 65 of file kis_slider_based_paintop_property.h.

◆ m_min

template<typename T >
T KisSliderBasedPaintOpProperty< T >::m_min
private

Definition at line 64 of file kis_slider_based_paintop_property.h.

◆ m_pageStep

template<typename T >
T KisSliderBasedPaintOpProperty< T >::m_pageStep
private

Definition at line 68 of file kis_slider_based_paintop_property.h.

◆ m_singleStep

template<typename T >
T KisSliderBasedPaintOpProperty< T >::m_singleStep
private

Definition at line 67 of file kis_slider_based_paintop_property.h.

◆ m_suffix

template<typename T >
QString KisSliderBasedPaintOpProperty< T >::m_suffix
private

Definition at line 72 of file kis_slider_based_paintop_property.h.


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