File indexing completed on 2024-05-19 04:26:55

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Laurent Valentin Jospin <laurent.valentin@famillejospin.ch>
0003  * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #include "DoubleParseSpinBox.h"
0009 
0010 struct DoubleParseSpinBox::Private {
0011     Private() {}
0012 
0013     KisDoubleParseSpinBox *widget;
0014 };
0015 
0016 DoubleParseSpinBox::DoubleParseSpinBox()
0017     : QObject()
0018     , d(new Private)
0019 {
0020     d->widget = new KisDoubleParseSpinBox();
0021 
0022     // Forward signals from KisDoubleParseSpinBox to DoubleParseSpinBox
0023     connect(d->widget, SIGNAL(errorWhileParsing(QString)), this, SIGNAL(errorWhileParsing(QString)));
0024     connect(d->widget, SIGNAL(noMoreParsingError()), this, SIGNAL(noMoreParsingError()));
0025 }
0026 
0027 DoubleParseSpinBox::~DoubleParseSpinBox()
0028 {
0029     delete d;
0030 }
0031 
0032 QDoubleSpinBox* DoubleParseSpinBox::widget() const
0033 {
0034     return d->widget;
0035 }
0036 
0037 void DoubleParseSpinBox::stepBy(int steps)
0038 {
0039     d->widget->stepBy(steps);
0040 }
0041 
0042 void DoubleParseSpinBox::setValue(double value, bool overwriteExpression)
0043 {
0044     d->widget->setValue(value, overwriteExpression);
0045 }
0046 
0047 bool DoubleParseSpinBox::isLastValid() const
0048 {
0049     return d->widget->isLastValid();
0050 }
0051 
0052 QString DoubleParseSpinBox::veryCleanText() const
0053 {
0054     return d->widget->veryCleanText();
0055 }