From cbff8db322bf8e99cb3e062cc47fd2fc0db81ac2 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Mon, 31 May 2010 14:49:15 +0200 Subject: Fix QT_NO_VALIDATOR compilation. Merge-request: 648 Reviewed-by: Andreas Aardal Hanssen --- src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 4 ++++ src/declarative/graphicsitems/qdeclarativetextinput.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativetextinput_p.h | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 151a9e9..0be8dac 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -112,9 +112,11 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType("Qt",4,7,"PathPercent"); qmlRegisterType("Qt",4,7,"PathQuad"); qmlRegisterType("Qt",4,7,"PathView"); +#ifndef QT_NO_VALIDATOR qmlRegisterType("Qt",4,7,"IntValidator"); qmlRegisterType("Qt",4,7,"DoubleValidator"); qmlRegisterType("Qt",4,7,"RegExpValidator"); +#endif qmlRegisterType("Qt",4,7,"Rectangle"); qmlRegisterType("Qt",4,7,"Repeater"); qmlRegisterType("Qt",4,7,"Rotation"); @@ -138,7 +140,9 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); +#ifndef QT_NO_VALIDATOR qmlRegisterType(); +#endif qmlRegisterType(); #ifndef QT_NO_ACTION qmlRegisterType(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 9c70ea9..305540f 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -648,6 +648,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b) \sa acceptableInput, inputMask */ +#ifndef QT_NO_VALIDATOR QValidator* QDeclarativeTextInput::validator() const { Q_D(const QDeclarativeTextInput); @@ -669,6 +670,7 @@ void QDeclarativeTextInput::setValidator(QValidator* v) emit validatorChanged(); } +#endif // QT_NO_VALIDATOR /*! \qmlproperty string TextInput::inputMask diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index 438293a..3dba844 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -79,7 +79,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged) Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength NOTIFY maximumLengthChanged) +#ifndef QT_NO_VALIDATOR Q_PROPERTY(QValidator* validator READ validator WRITE setValidator NOTIFY validatorChanged) +#endif Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask NOTIFY inputMaskChanged) Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints) @@ -156,9 +158,10 @@ public: int maxLength() const; void setMaxLength(int ml); +#ifndef QT_NO_VALIDATOR QValidator * validator() const; void setValidator(QValidator* v); - +#endif QString inputMask() const; void setInputMask(const QString &im); @@ -248,10 +251,12 @@ private: QT_END_NAMESPACE QML_DECLARE_TYPE(QDeclarativeTextInput) +#ifndef QT_NO_VALIDATOR QML_DECLARE_TYPE(QValidator) QML_DECLARE_TYPE(QIntValidator) QML_DECLARE_TYPE(QDoubleValidator) QML_DECLARE_TYPE(QRegExpValidator) +#endif QT_END_HEADER -- cgit v0.12