qvalidator.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // qvalidator.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QValidator : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qvalidator.h>
  25. %End
  26. public:
  27. explicit QValidator(QObject *parent /TransferThis/ = 0);
  28. virtual ~QValidator();
  29. enum State
  30. {
  31. Invalid,
  32. Intermediate,
  33. Acceptable,
  34. };
  35. virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const = 0;
  36. virtual void fixup(QString & /In,Out/) const;
  37. void setLocale(const QLocale &locale);
  38. QLocale locale() const;
  39. signals:
  40. void changed();
  41. };
  42. class QIntValidator : public QValidator
  43. {
  44. %TypeHeaderCode
  45. #include <qvalidator.h>
  46. %End
  47. public:
  48. explicit QIntValidator(QObject *parent /TransferThis/ = 0);
  49. QIntValidator(int bottom, int top, QObject *parent /TransferThis/ = 0);
  50. virtual ~QIntValidator();
  51. virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
  52. virtual void fixup(QString &input /In,Out/) const;
  53. void setBottom(int);
  54. void setTop(int);
  55. void setRange(int bottom, int top);
  56. int bottom() const;
  57. int top() const;
  58. };
  59. class QDoubleValidator : public QValidator
  60. {
  61. %TypeHeaderCode
  62. #include <qvalidator.h>
  63. %End
  64. public:
  65. explicit QDoubleValidator(QObject *parent /TransferThis/ = 0);
  66. QDoubleValidator(double bottom, double top, int decimals, QObject *parent /TransferThis/ = 0);
  67. virtual ~QDoubleValidator();
  68. virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
  69. void setRange(double bottom, double top, int decimals = 0);
  70. void setBottom(double);
  71. void setTop(double);
  72. void setDecimals(int);
  73. double bottom() const;
  74. double top() const;
  75. int decimals() const;
  76. enum Notation
  77. {
  78. StandardNotation,
  79. ScientificNotation,
  80. };
  81. void setNotation(QDoubleValidator::Notation);
  82. QDoubleValidator::Notation notation() const;
  83. %If (Qt_6_3_0 -)
  84. virtual void fixup(QString &input) const;
  85. %End
  86. };
  87. class QRegularExpressionValidator : public QValidator
  88. {
  89. %TypeHeaderCode
  90. #include <qvalidator.h>
  91. %End
  92. public:
  93. explicit QRegularExpressionValidator(QObject *parent /TransferThis/ = 0);
  94. QRegularExpressionValidator(const QRegularExpression &re, QObject *parent /TransferThis/ = 0);
  95. virtual ~QRegularExpressionValidator();
  96. virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
  97. QRegularExpression regularExpression() const;
  98. void setRegularExpression(const QRegularExpression &re);
  99. };