Krita Source Code Documentation
Loading...
Searching...
No Matches
IntParseSpinBox.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
8#include "IntParseSpinBox.h"
9
15
17 : QObject()
18 , d(new Private)
19{
21
22 // Forward signals from KisIntParseSpinBox to IntParseSpinBox
23 connect(d->widget, SIGNAL(errorWhileParsing(QString)), this, SIGNAL(errorWhileParsing(QString)));
24 connect(d->widget, SIGNAL(noMoreParsingError()), this, SIGNAL(noMoreParsingError()));
25}
26
31
32QSpinBox* IntParseSpinBox::widget() const
33{
34 return d->widget;
35}
36
38{
39 d->widget->stepBy(steps);
40}
41
42void IntParseSpinBox::setValue(int 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()))
~IntParseSpinBox() override
void stepBy(int steps)
This is a reimplementation of QSpinBox::stepBy that uses setValue.
QSpinBox * widget() const
Get the internal KisIntParseSpinBox as a QWidget, so it may be added to a UI.
void errorWhileParsing(const QString &expr) const
signal emitted when the last parsed expression is not valid.
void setValue(int value, bool overwriteExpression=false)
Set the value of the spinbox.
Private *const d
void noMoreParsingError() const
signal emitted when the last parsed expression is valid and the expression before was not valid.
virtual QString veryCleanText() const
This virtual function is similar to cleanText(). But child classes may reimplement it to further proc...
bool isLastValid() const
Get if the last expression entered is a valid one.
The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
virtual QString veryCleanText() const
This virtual function is similar to cleanText(). But child classes may reimplement it to further proc...
bool isLastValid() const
Get if the last expression entered is a valid one.
void setValue(int value, bool overwriteExpression=false)
Set the value of the spinbox.
void stepBy(int steps) override
This is a reimplementation of QSpinBox::stepBy that uses setValue.