summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2010-05-31 14:49:15 +0200
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2010-05-31 14:50:45 +0200
commitcbff8db322bf8e99cb3e062cc47fd2fc0db81ac2 (patch)
tree2bddbb7846e0efe128c26ab1765321c9418fbf4c /src
parentde904c51b140e11c801471871632d1d1b552e470 (diff)
Fix QT_NO_VALIDATOR compilation.
Merge-request: 648 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h7
3 files changed, 12 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 151a9e9a82..0be8dac4f6 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -112,9 +112,11 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativePathPercent>("Qt",4,7,"PathPercent");
qmlRegisterType<QDeclarativePathQuad>("Qt",4,7,"PathQuad");
qmlRegisterType<QDeclarativePathView>("Qt",4,7,"PathView");
+#ifndef QT_NO_VALIDATOR
qmlRegisterType<QIntValidator>("Qt",4,7,"IntValidator");
qmlRegisterType<QDoubleValidator>("Qt",4,7,"DoubleValidator");
qmlRegisterType<QRegExpValidator>("Qt",4,7,"RegExpValidator");
+#endif
qmlRegisterType<QDeclarativeRectangle>("Qt",4,7,"Rectangle");
qmlRegisterType<QDeclarativeRepeater>("Qt",4,7,"Repeater");
qmlRegisterType<QGraphicsRotation>("Qt",4,7,"Rotation");
@@ -138,7 +140,9 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativePathElement>();
qmlRegisterType<QDeclarativeCurve>();
qmlRegisterType<QDeclarativeScaleGrid>();
+#ifndef QT_NO_VALIDATOR
qmlRegisterType<QValidator>();
+#endif
qmlRegisterType<QDeclarativeVisualModel>();
#ifndef QT_NO_ACTION
qmlRegisterType<QAction>();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 9c70ea9fa3..305540f447 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 438293a6ab..3dba8444ac 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