diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-02 14:20:16 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-03 16:05:04 +0200 |
commit | de78425ca0c508eb02aaac794ecbcda5ff09a5eb (patch) | |
tree | 67e5c7b1efe5442d1c386e45718c46eb024625be /src/gui/util | |
parent | af6f3cb31772fcc05d3e1e55c72210390d4df4e6 (diff) |
Make setRange methods in QValidator subclasses non-virtual
As per the FIXME comment. These functions are not called by Qt, so no
reason to have them virtual.
As a drive-by, remove redundant virtual keyword from overrides.
[ChangeLog][QtGui][QValidator] QIntValidator::setRange and
QDoubleValidator::setRange are no longer declared as virtual.
Change-Id: I640646fb18ed50554e384ed67ac85b3f408ea8cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qvalidator.cpp | 4 | ||||
-rw-r--r-- | src/gui/util/qvalidator.h | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp index b01b09c0f9..61eed3fff1 100644 --- a/src/gui/util/qvalidator.cpp +++ b/src/gui/util/qvalidator.cpp @@ -456,8 +456,6 @@ void QIntValidator::fixup(QString &input) const input = locale().toString(entered); } -// FIXME: Qt 6: Make QIntValidator::setRange() non-virtual - /*! Sets the range of the validator to only accept integers between \a bottom and \a top inclusive. @@ -708,8 +706,6 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL return QValidator::Intermediate; } -// FIXME: Qt 6: Make QDoubleValidator::setRange() non-virtual - /*! Sets the validator to accept doubles from \a minimum to \a maximum inclusive, with at most \a decimals digits after the decimal diff --git a/src/gui/util/qvalidator.h b/src/gui/util/qvalidator.h index 38e2e6c130..7e72a60f24 100644 --- a/src/gui/util/qvalidator.h +++ b/src/gui/util/qvalidator.h @@ -104,7 +104,7 @@ public: void setBottom(int); void setTop(int); - virtual void setRange(int bottom, int top); + void setRange(int bottom, int top); int bottom() const { return b; } int top() const { return t; } @@ -141,7 +141,7 @@ public: Q_ENUM(Notation) QValidator::State validate(QString &, int &) const override; - virtual void setRange(double bottom, double top, int decimals = 0); + void setRange(double bottom, double top, int decimals = 0); void setBottom(double); void setTop(double); void setDecimals(int); @@ -181,7 +181,7 @@ public: explicit QRegularExpressionValidator(const QRegularExpression &re, QObject *parent = nullptr); ~QRegularExpressionValidator(); - virtual QValidator::State validate(QString &input, int &pos) const override; + QValidator::State validate(QString &input, int &pos) const override; QRegularExpression regularExpression() const; |