1// qvalidator.sip generated by MetaSIP 2// 3// This file is part of the QtGui 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 QValidator : QObject 24{ 25%TypeHeaderCode 26#include <qvalidator.h> 27%End 28 29public: 30 explicit QValidator(QObject *parent /TransferThis/ = 0); 31 virtual ~QValidator(); 32 33 enum State 34 { 35 Invalid, 36 Intermediate, 37 Acceptable, 38 }; 39 40 virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const = 0; 41 virtual void fixup(QString & /In,Out/) const; 42 void setLocale(const QLocale &locale); 43 QLocale locale() const; 44 45signals: 46 void changed(); 47}; 48 49class QIntValidator : QValidator 50{ 51%TypeHeaderCode 52#include <qvalidator.h> 53%End 54 55public: 56 explicit QIntValidator(QObject *parent /TransferThis/ = 0); 57 QIntValidator(int bottom, int top, QObject *parent /TransferThis/ = 0); 58 virtual ~QIntValidator(); 59 virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const; 60 virtual void fixup(QString &input /In,Out/) const; 61 void setBottom(int); 62 void setTop(int); 63 virtual void setRange(int bottom, int top); 64 int bottom() const; 65 int top() const; 66}; 67 68class QDoubleValidator : QValidator 69{ 70%TypeHeaderCode 71#include <qvalidator.h> 72%End 73 74public: 75 explicit QDoubleValidator(QObject *parent /TransferThis/ = 0); 76 QDoubleValidator(double bottom, double top, int decimals, QObject *parent /TransferThis/ = 0); 77 virtual ~QDoubleValidator(); 78 virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const; 79 virtual void setRange(double minimum, double maximum, int decimals = 0); 80 void setBottom(double); 81 void setTop(double); 82 void setDecimals(int); 83 double bottom() const; 84 double top() const; 85 int decimals() const; 86 87 enum Notation 88 { 89 StandardNotation, 90 ScientificNotation, 91 }; 92 93 void setNotation(QDoubleValidator::Notation); 94 QDoubleValidator::Notation notation() const; 95}; 96 97class QRegExpValidator : QValidator 98{ 99%TypeHeaderCode 100#include <qvalidator.h> 101%End 102 103public: 104 explicit QRegExpValidator(QObject *parent /TransferThis/ = 0); 105 QRegExpValidator(const QRegExp &rx, QObject *parent /TransferThis/ = 0); 106 virtual ~QRegExpValidator(); 107 virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const; 108 void setRegExp(const QRegExp &rx); 109 const QRegExp ®Exp() const; 110}; 111 112%If (Qt_5_1_0 -) 113 114class QRegularExpressionValidator : QValidator 115{ 116%TypeHeaderCode 117#include <qvalidator.h> 118%End 119 120public: 121 explicit QRegularExpressionValidator(QObject *parent /TransferThis/ = 0); 122 QRegularExpressionValidator(const QRegularExpression &re, QObject *parent /TransferThis/ = 0); 123 virtual ~QRegularExpressionValidator(); 124 virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const; 125 QRegularExpression regularExpression() const; 126 void setRegularExpression(const QRegularExpression &re); 127}; 128 129%End 130