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>
This commit is contained in:
parent
af6f3cb317
commit
de78425ca0
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user