Krita Source Code Documentation
Loading...
Searching...
No Matches
DoubleParseSpinBox.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Laurent Valentin Jospin <laurent.valentin@famillejospin.ch>
3 * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
9
15
17 : QObject()
18 , d(new Private)
19{
21
22 // Forward signals from KisDoubleParseSpinBox to DoubleParseSpinBox
23 connect(d->widget, SIGNAL(errorWhileParsing(QString)), this, SIGNAL(errorWhileParsing(QString)));
24 connect(d->widget, SIGNAL(noMoreParsingError()), this, SIGNAL(noMoreParsingError()));
25}
26
31
32QDoubleSpinBox* DoubleParseSpinBox::widget() const
33{
34 return d->widget;
35}
36
38{
39 d->widget->stepBy(steps);
40}
41
42void DoubleParseSpinBox::setValue(double value, bool overwriteExpression)
43{
44 d->widget->setValue(value, overwriteExpression);
45}
46
48{
49 return d->widget->isLastValid();
50}
51
53{
54 return d->widget->veryCleanText();
55}
float value(const T *src, size_t ch)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QDoubleSpinBox * widget() const
Get the internal KisDoubleParseSpinBox as a QWidget, so it may be added to a UI.
void noMoreParsingError() const
signal emitted when the last parsed expression is valid and the expression before was not valid.
bool isLastValid() const
Get if the last expression entered is a valid one.
void stepBy(int steps)
This is a reimplementation of QDoubleSpinBox::stepBy that uses setValue.
virtual QString veryCleanText() const
This virtual function is similar to cleanText(). But child classes may reimplement it to further proc...
void setValue(double value, bool overwriteExpression=false)
Set the value of the spinbox.
void errorWhileParsing(const QString &expr) const
signal emitted when the last parsed expression is not valid.
The KisDoubleParseSpinBox class is a cleverer doubleSpinBox, able to parse arithmetic expressions.
bool isLastValid() const
Get if the last expression entered is a valid one.
void setValue(double value, bool overwriteExpression=false)
Set the value of the spinbox.
void stepBy(int steps) override
This is a reimplementation of QDoubleSpinBox::stepBy that uses setValue.
virtual QString veryCleanText() const
This virtual function is similar to cleanText(). But child classes may reimplement it to further proc...