1// qspinbox.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QSpinBox : QAbstractSpinBox
24{
25%TypeHeaderCode
26#include <qspinbox.h>
27%End
28
29public:
30    explicit QSpinBox(QWidget *parent /TransferThis/ = 0);
31    virtual ~QSpinBox();
32    int value() const;
33    QString prefix() const;
34    void setPrefix(const QString &p);
35    QString suffix() const;
36    void setSuffix(const QString &s);
37    QString cleanText() const;
38    int singleStep() const;
39    void setSingleStep(int val);
40    int minimum() const;
41    void setMinimum(int min);
42    int maximum() const;
43    void setMaximum(int max);
44    void setRange(int min, int max);
45
46protected:
47    virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
48    virtual int valueFromText(const QString &text) const;
49    virtual QString textFromValue(int v) const;
50    virtual void fixup(QString &str /In,Out/) const;
51    virtual bool event(QEvent *e);
52
53public slots:
54    void setValue(int val);
55
56signals:
57    void valueChanged(int);
58    void valueChanged(const QString &);
59%If (Qt_5_14_0 -)
60    void textChanged(const QString &);
61%End
62
63public:
64%If (Qt_5_2_0 -)
65    int displayIntegerBase() const;
66%End
67%If (Qt_5_2_0 -)
68    void setDisplayIntegerBase(int base);
69%End
70%If (Qt_5_12_0 -)
71    QAbstractSpinBox::StepType stepType() const;
72%End
73%If (Qt_5_12_0 -)
74    void setStepType(QAbstractSpinBox::StepType stepType);
75%End
76};
77
78class QDoubleSpinBox : QAbstractSpinBox
79{
80%TypeHeaderCode
81#include <qspinbox.h>
82%End
83
84public:
85    explicit QDoubleSpinBox(QWidget *parent /TransferThis/ = 0);
86    virtual ~QDoubleSpinBox();
87    double value() const;
88    QString prefix() const;
89    void setPrefix(const QString &p);
90    QString suffix() const;
91    void setSuffix(const QString &s);
92    QString cleanText() const;
93    double singleStep() const;
94    void setSingleStep(double val);
95    double minimum() const;
96    void setMinimum(double min);
97    double maximum() const;
98    void setMaximum(double max);
99    void setRange(double min, double max);
100    int decimals() const;
101    void setDecimals(int prec);
102    virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
103    virtual double valueFromText(const QString &text) const;
104    virtual QString textFromValue(double v) const;
105    virtual void fixup(QString &str /In,Out/) const;
106
107public slots:
108    void setValue(double val);
109
110signals:
111    void valueChanged(double);
112    void valueChanged(const QString &);
113%If (Qt_5_14_0 -)
114    void textChanged(const QString &);
115%End
116
117public:
118%If (Qt_5_12_0 -)
119    QAbstractSpinBox::StepType stepType() const;
120%End
121%If (Qt_5_12_0 -)
122    void setStepType(QAbstractSpinBox::StepType stepType);
123%End
124};
125