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

#include <MyPaintCurveOptionRangeControlsStrategy.h>

+ Inheritance diagram for MyPaintCurveOptionRangeControlsStrategy:

Public Member Functions

 MyPaintCurveOptionRangeControlsStrategy (KisCurveRangeModelInterface *rangeInterface, QWidget *rangeControlsPlaceholder)
 
 ~MyPaintCurveOptionRangeControlsStrategy ()
 
- Public Member Functions inherited from KisCurveOptionRangeControlsStrategyInterface
virtual ~KisCurveOptionRangeControlsStrategyInterface ()
 

Static Public Member Functions

static KisCurveOptionRangeControlsStrategyFactory factory ()
 

Private Attributes

MyPaintCurveRangeModelm_rangeModel
 
lager::reader< QString > m_xValueSuffix
 
lager::reader< QString > m_yValueSuffix
 

Detailed Description

Definition at line 16 of file MyPaintCurveOptionRangeControlsStrategy.h.

Constructor & Destructor Documentation

◆ MyPaintCurveOptionRangeControlsStrategy()

MyPaintCurveOptionRangeControlsStrategy::MyPaintCurveOptionRangeControlsStrategy ( KisCurveRangeModelInterface * rangeInterface,
QWidget * rangeControlsPlaceholder )

Definition at line 20 of file MyPaintCurveOptionRangeControlsStrategy.cpp.

21 : m_rangeModel(dynamic_cast<MyPaintCurveRangeModel*>(rangeInterface))
24{
25 using namespace KisWidgetConnectionUtils;
27
28 KisDoubleSliderSpinBox *yLimitSlider = new KisDoubleSliderSpinBox(rangeControlsPlaceholder);
29 yLimitSlider->setPrefix(i18n("Y limit: "));
30 yLimitSlider->setRange(0.0, m_rangeModel->maxYRange(), 2);
31 m_yValueSuffix.bind(std::bind(&KisDoubleSliderSpinBox::setSuffix, yLimitSlider, std::placeholders::_1));
32 connectControl(yLimitSlider, m_rangeModel, "yLimit");
33
34 KisDoubleSliderSpinBox *xMin = new KisDoubleSliderSpinBox(rangeControlsPlaceholder);
35 xMin->setPrefix(i18n("X min: "));
36 m_xValueSuffix.bind(std::bind(&KisDoubleSliderSpinBox::setSuffix, xMin, std::placeholders::_1));
37 connectControlState(xMin, m_rangeModel, "xMinState", "xMin");
38
39 KisDoubleSliderSpinBox *xMax = new KisDoubleSliderSpinBox(rangeControlsPlaceholder);
40 xMax->setPrefix(i18n("X max: "));
41 m_xValueSuffix.bind(std::bind(&KisDoubleSliderSpinBox::setSuffix, xMax, std::placeholders::_1));
42 connectControlState(xMax, m_rangeModel, "xMaxState", "xMax");
43
44 QHBoxLayout *xRangeLayout = new QHBoxLayout();
45 xRangeLayout->addWidget(xMin);
46 xRangeLayout->addWidget(xMax);
47
48 QVBoxLayout *layout = new QVBoxLayout(rangeControlsPlaceholder);
49 layout->addWidget(yLimitSlider);
50 layout->addLayout(xRangeLayout);
51
52}
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
lager::reader< QString > yValueSuffix() override
qreal maxYRange() const
lager::reader< QString > xValueSuffix() override
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
void connectControl(KisCompositeOpListWidget *widget, QObject *source, const char *property)
void connectControlState(QSpinBox *spinBox, QObject *source, const char *readStateProperty, const char *writeProperty)

References KIS_SAFE_ASSERT_RECOVER_RETURN, m_rangeModel, m_xValueSuffix, m_yValueSuffix, MyPaintCurveRangeModel::maxYRange(), and KisDoubleSliderSpinBox::setRange().

◆ ~MyPaintCurveOptionRangeControlsStrategy()

MyPaintCurveOptionRangeControlsStrategy::~MyPaintCurveOptionRangeControlsStrategy ( )

Definition at line 54 of file MyPaintCurveOptionRangeControlsStrategy.cpp.

55{
56
57}

Member Function Documentation

◆ factory()

KisCurveOptionRangeControlsStrategyFactory MyPaintCurveOptionRangeControlsStrategy::factory ( )
static

Definition at line 59 of file MyPaintCurveOptionRangeControlsStrategy.cpp.

60{
61 return [] (KisCurveRangeModelInterface *rangeInterface, QWidget *rangeControlsPlaceholder) {
62 return new MyPaintCurveOptionRangeControlsStrategy(rangeInterface, rangeControlsPlaceholder);
63 };
64}
MyPaintCurveOptionRangeControlsStrategy(KisCurveRangeModelInterface *rangeInterface, QWidget *rangeControlsPlaceholder)

References MyPaintCurveOptionRangeControlsStrategy().

Member Data Documentation

◆ m_rangeModel

MyPaintCurveRangeModel* MyPaintCurveOptionRangeControlsStrategy::m_rangeModel
private

Definition at line 26 of file MyPaintCurveOptionRangeControlsStrategy.h.

◆ m_xValueSuffix

lager::reader<QString> MyPaintCurveOptionRangeControlsStrategy::m_xValueSuffix
private

Definition at line 27 of file MyPaintCurveOptionRangeControlsStrategy.h.

◆ m_yValueSuffix

lager::reader<QString> MyPaintCurveOptionRangeControlsStrategy::m_yValueSuffix
private

Definition at line 28 of file MyPaintCurveOptionRangeControlsStrategy.h.


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