Krita

IntParseSpinBox.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 "IntParseSpinBox.h"
9
10struct IntParseSpinBox::Private {
11 Private() {}
12
13 KisIntParseSpinBox *widget;
14};
15
16IntParseSpinBox::IntParseSpinBox()
17 : QObject()
18 , d(new Private)
19{
20 d->widget = new KisIntParseSpinBox();
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
27IntParseSpinBox::~IntParseSpinBox()
28{
29 delete d;
30}
31
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}
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 setValue(int value, bool overwriteExpression=false)
Set the value of the spinbox.
virtual QString veryCleanText() const
This virtual function is similar to cleanText().
bool isLastValid() const
Get if the last expression entered is a valid one.
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 Mon Nov 4 2024 16:35:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.