File indexing completed on 2024-05-12 16:43:57

0001 /*
0002     SPDX-FileCopyrightText: 2016-2019 Thomas Baumgart <tbaumgart@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef AMOUNTVALIDATOR_H
0007 #define AMOUNTVALIDATOR_H
0008 
0009 #include "kmm_widgets_export.h"
0010 
0011 // ----------------------------------------------------------------------------
0012 // QT Includes
0013 
0014 #include <QDoubleValidator>
0015 
0016 // ----------------------------------------------------------------------------
0017 // KDE Includes
0018 
0019 // ----------------------------------------------------------------------------
0020 // Project Includes
0021 
0022 /**
0023   * This class is a specialization of the QDoubleValidator
0024   * which uses the StandardNotation instead of the
0025   * ScientificNotation as the default
0026   *
0027   * @author Thomas Baumgart
0028   */
0029 class AmountValidator : public QDoubleValidator
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     explicit AmountValidator(QObject * parent);
0035     explicit AmountValidator(double bottom, double top, int decimals,
0036                              QObject * parent);
0037 
0038     virtual QValidator::State validate(QString& input, int& pos) const override;
0039 };
0040 
0041 #endif