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

#include <black_white_point_chooser.h>

+ Inheritance diagram for BlackWhitePointChooser:

Signals

void sigBlackPointChanged (qreal value)
 
void sigWhitePointChanged (qreal value)
 

Public Member Functions

qreal blackPoint () const
 
 BlackWhitePointChooser (QWidget *parent)
 
void setBlackPoint (qreal bp)
 
void setWhitePoint (qreal wp)
 
void showPopup (const QPoint &basePoint)
 
qreal whitePoint () const
 
 ~BlackWhitePointChooser ()
 

Private Attributes

KisDoubleSliderSpinBoxm_black
 
KisDoubleSliderSpinBoxm_white
 

Detailed Description

Definition at line 15 of file black_white_point_chooser.h.

Constructor & Destructor Documentation

◆ BlackWhitePointChooser()

BlackWhitePointChooser::BlackWhitePointChooser ( QWidget * parent)

Definition at line 20 of file black_white_point_chooser.cpp.

21 : QFrame(parent, Qt::Popup)
22{
23 setFrameStyle(QFrame::Panel|QFrame::Raised);
24
26 m_black->setRange(0.0, 10000, 4);
27 m_black->setValue(0.0);
28 m_black->setSingleStep(0.01);
29 m_black->setMinimumWidth(120);
31
33 m_white->setRange(0.0, 10000, 4);
34 m_white->setValue(1.0);
35 m_white->setSingleStep(0.01);
36 m_white->setMinimumWidth(120);
38
39 connect(m_black, SIGNAL(valueChanged(qreal)), SIGNAL(sigBlackPointChanged(qreal)));
40 connect(m_white, SIGNAL(valueChanged(qreal)), SIGNAL(sigWhitePointChanged(qreal)));
41
42 QFormLayout *layout = new QFormLayout(this);
43 layout->addRow(i18n("Black:"), m_black);
44 layout->addRow(i18n("White:"), m_white);
45}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigWhitePointChanged(qreal value)
KisDoubleSliderSpinBox * m_black
KisDoubleSliderSpinBox * m_white
void sigBlackPointChanged(qreal value)
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(qreal newValue)
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
void setExponentRatio(qreal newExponentRatio)

References connect(), m_black, m_white, KisDoubleSliderSpinBox::setExponentRatio(), KisDoubleSliderSpinBox::setRange(), KisDoubleSliderSpinBox::setValue(), sigBlackPointChanged(), and sigWhitePointChanged().

◆ ~BlackWhitePointChooser()

BlackWhitePointChooser::~BlackWhitePointChooser ( )

Definition at line 47 of file black_white_point_chooser.cpp.

48{
49}

Member Function Documentation

◆ blackPoint()

qreal BlackWhitePointChooser::blackPoint ( ) const

Definition at line 63 of file black_white_point_chooser.cpp.

64{
65 return m_black->value();
66}

References m_black.

◆ setBlackPoint()

void BlackWhitePointChooser::setBlackPoint ( qreal bp)

Definition at line 68 of file black_white_point_chooser.cpp.

69{
70 m_black->setValue(bp);
71}

References m_black, and KisDoubleSliderSpinBox::setValue().

◆ setWhitePoint()

void BlackWhitePointChooser::setWhitePoint ( qreal wp)

Definition at line 78 of file black_white_point_chooser.cpp.

79{
80 m_white->setValue(wp);
81}

References m_white, and KisDoubleSliderSpinBox::setValue().

◆ showPopup()

void BlackWhitePointChooser::showPopup ( const QPoint & basePoint)

Definition at line 51 of file black_white_point_chooser.cpp.

52{
53 show();
54
55 QSize popupSize = size();
56 QRect popupRect(basePoint - QPoint(0, popupSize.height()), popupSize);
57 QRect screenRect = this->screen()->availableGeometry();
58
59 popupRect = kisEnsureInRect(popupRect, screenRect);
60 setGeometry(popupRect);
61}
QRect kisEnsureInRect(QRect rc, const QRect &bounds)
Definition kis_global.h:267
int size(const Forest< T > &forest)
Definition KisForest.h:1232
const NumericSetting< int > popupSize
Definition WGConfig.cpp:244

References kisEnsureInRect().

◆ sigBlackPointChanged

void BlackWhitePointChooser::sigBlackPointChanged ( qreal value)
signal

◆ sigWhitePointChanged

void BlackWhitePointChooser::sigWhitePointChanged ( qreal value)
signal

◆ whitePoint()

qreal BlackWhitePointChooser::whitePoint ( ) const

Definition at line 73 of file black_white_point_chooser.cpp.

74{
75 return m_white->value();
76}

References m_white.

Member Data Documentation

◆ m_black

KisDoubleSliderSpinBox* BlackWhitePointChooser::m_black
private

Definition at line 35 of file black_white_point_chooser.h.

◆ m_white

KisDoubleSliderSpinBox* BlackWhitePointChooser::m_white
private

Definition at line 36 of file black_white_point_chooser.h.


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