summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qvalidator.h
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2011-07-26 13:46:54 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-29 02:21:16 +0200
commita2c0390468b91a3f8a97a3bbabc2f9c98e0d105a (patch)
treea2f8206a8d42d18d21bc051fe1a6df1584c10dcc /src/gui/widgets/qvalidator.h
parentade2ef0a3e2fcf92a153f5e44f726ee603df12aa (diff)
Add notify signals for QIntvalidator, QDoubleValidator, QRegExpValidator
Task-number:QTBUG-19956 Change-Id: I5ab5e4494189ece5b0eb1f63e73e49cb2c4e9656 Reviewed-by:Michael Brasser Reviewed-on: http://codereview.qt.nokia.com/2147 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/gui/widgets/qvalidator.h')
-rw-r--r--src/gui/widgets/qvalidator.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h
index 70f656e6a8..cb0436cc3e 100644
--- a/src/gui/widgets/qvalidator.h
+++ b/src/gui/widgets/qvalidator.h
@@ -96,8 +96,8 @@ private:
class Q_GUI_EXPORT QIntValidator : public QValidator
{
Q_OBJECT
- Q_PROPERTY(int bottom READ bottom WRITE setBottom)
- Q_PROPERTY(int top READ top WRITE setTop)
+ Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY bottomChanged)
+ Q_PROPERTY(int top READ top WRITE setTop NOTIFY topChanged)
public:
explicit QIntValidator(QObject * parent = 0);
@@ -113,7 +113,9 @@ public:
int bottom() const { return b; }
int top() const { return t; }
-
+Q_SIGNALS:
+ void bottomChanged(int bottom);
+ void topChanged(int top);
#ifdef QT3_SUPPORT
public:
QT3_SUPPORT_CONSTRUCTOR QIntValidator(QObject * parent, const char *name);
@@ -134,11 +136,11 @@ class QDoubleValidatorPrivate;
class Q_GUI_EXPORT QDoubleValidator : public QValidator
{
Q_OBJECT
- Q_PROPERTY(double bottom READ bottom WRITE setBottom)
- Q_PROPERTY(double top READ top WRITE setTop)
- Q_PROPERTY(int decimals READ decimals WRITE setDecimals)
+ Q_PROPERTY(double bottom READ bottom WRITE setBottom NOTIFY bottomChanged)
+ Q_PROPERTY(double top READ top WRITE setTop NOTIFY topChanged)
+ Q_PROPERTY(int decimals READ decimals WRITE setDecimals NOTIFY decimalsChanged)
Q_ENUMS(Notation)
- Q_PROPERTY(Notation notation READ notation WRITE setNotation)
+ Q_PROPERTY(Notation notation READ notation WRITE setNotation NOTIFY notationChanged)
public:
explicit QDoubleValidator(QObject * parent = 0);
@@ -149,7 +151,6 @@ public:
StandardNotation,
ScientificNotation
};
-
QValidator::State validate(QString &, int &) const;
virtual void setRange(double bottom, double top, int decimals = 0);
@@ -163,6 +164,12 @@ public:
int decimals() const { return dec; }
Notation notation() const;
+Q_SIGNALS:
+ void bottomChanged(double bottom);
+ void topChanged(double top);
+ void decimalsChanged(int decimals);
+ void notationChanged(QDoubleValidator::Notation notation);
+
#ifdef QT3_SUPPORT
public:
QT3_SUPPORT_CONSTRUCTOR QDoubleValidator(QObject * parent, const char *name);
@@ -182,7 +189,7 @@ private:
class Q_GUI_EXPORT QRegExpValidator : public QValidator
{
Q_OBJECT
- Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp)
+ Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp NOTIFY regExpChanged)
public:
explicit QRegExpValidator(QObject *parent = 0);
@@ -194,6 +201,8 @@ public:
void setRegExp(const QRegExp& rx);
const QRegExp& regExp() const { return r; } // ### make inline for 5.0
+Q_SIGNALS:
+ void regExpChanged(const QRegExp& regExp);
#ifdef QT3_SUPPORT
public:
QT3_SUPPORT_CONSTRUCTOR QRegExpValidator(QObject *parent, const char *name);