Krita

DoubleParseSpinBox.cpp
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 "DoubleParseSpinBox.h"
9
10struct DoubleParseSpinBox::Private {
11 Private() {}
12
14};
15
16DoubleParseSpinBox::DoubleParseSpinBox()
17 : QObject()
18 , d(new Private)
19{
20 d->widget = new KisDoubleParseSpinBox();
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
27DoubleParseSpinBox::~DoubleParseSpinBox()
28{
29 delete d;
30}
31
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}
QDoubleSpinBox * widget() const
Get the internal KisDoubleParseSpinBox as a QWidget, so it may be added to a UI.
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().
void setValue(double value, bool overwriteExpression=false)
Set the value of the spinbox.
T qobject_cast(QObject *object)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:51:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.