aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-09-09 17:35:33 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2014-11-01 11:43:57 +0100
commit492c611d2bd1344c325b447c1cba87cf7c97e988 (patch)
treeb5ad6815ca457f6b632809ee13f2178dd4552b37 /src
parent890b02a6f1f7454f0c3f045f717806bfed66da7f (diff)
QQuickTextInput: don't ifdef out properties
Take out the implementation body instead. These conditional properties are causing trouble for controls (invalid alias location). Change-Id: I055e149a4fe2d4d5d0c62d21e5f5368e9973c512 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquicktextinput.cpp28
-rw-r--r--src/quick/items/qquicktextinput_p.h15
2 files changed, 24 insertions, 19 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 1f03fb21e2..d1bf022184 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1021,6 +1021,8 @@ void QQuickDoubleValidator::resetLocaleName()
}
}
+#endif // QT_NO_VALIDATOR
+
/*!
\qmlproperty real QtQuick::DoubleValidator::top
@@ -1099,12 +1101,19 @@ void QQuickDoubleValidator::resetLocaleName()
QValidator* QQuickTextInput::validator() const
{
+#ifdef QT_NO_VALIDATOR
+ return 0;
+#else
Q_D(const QQuickTextInput);
return d->m_validator;
+#endif // QT_NO_VALIDATOR
}
void QQuickTextInput::setValidator(QValidator* v)
{
+#ifdef QT_NO_VALIDATOR
+ Q_UNUSED(v);
+#else
Q_D(QQuickTextInput);
if (d->m_validator == v)
return;
@@ -1127,14 +1136,15 @@ void QQuickTextInput::setValidator(QValidator* v)
d->checkIsValid();
emit validatorChanged();
+#endif // QT_NO_VALIDATOR
}
+#ifndef QT_NO_VALIDATOR
void QQuickTextInput::q_validatorChanged()
{
Q_D(QQuickTextInput);
d->checkIsValid();
}
-
#endif // QT_NO_VALIDATOR
void QQuickTextInputPrivate::checkIsValid()
@@ -1267,7 +1277,6 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
emit echoModeChanged(echoMode());
}
-#ifndef QT_NO_IM
/*!
\qmlproperty enumeration QtQuick::TextInput::inputMethodHints
@@ -1316,12 +1325,19 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
Qt::InputMethodHints QQuickTextInput::inputMethodHints() const
{
+#ifdef QT_NO_IM
+ return Qt::ImhNone;
+#else
Q_D(const QQuickTextInput);
return d->inputMethodHints;
+#endif // QT_NO_IM
}
void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
{
+#ifdef QT_NO_IM
+ Q_UNUSED(hints);
+#else
Q_D(QQuickTextInput);
if (hints == d->inputMethodHints)
@@ -1330,8 +1346,8 @@ void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
d->inputMethodHints = hints;
updateInputMethod(Qt::ImHints);
emit inputMethodHintsChanged();
-}
#endif // QT_NO_IM
+}
/*!
\qmlproperty Component QtQuick::TextInput::cursorDelegate
@@ -2590,7 +2606,6 @@ void QQuickTextInput::focusOutEvent(QFocusEvent *event)
QQuickImplicitSizeItem::focusOutEvent(event);
}
-#ifndef QT_NO_IM
/*!
\qmlproperty bool QtQuick::TextInput::inputMethodComposing
@@ -2605,10 +2620,13 @@ void QQuickTextInput::focusOutEvent(QFocusEvent *event)
*/
bool QQuickTextInput::isInputMethodComposing() const
{
+#ifdef QT_NO_IM
+ return false;
+#else
Q_D(const QQuickTextInput);
return d->hasImState;
-}
#endif
+}
void QQuickTextInputPrivate::init()
{
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h
index ad2c579001..0d32cb2179 100644
--- a/src/quick/items/qquicktextinput_p.h
+++ b/src/quick/items/qquicktextinput_p.h
@@ -74,13 +74,9 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
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)
-#ifndef QT_NO_IM
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged)
-#endif
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
@@ -95,9 +91,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)
Q_PROPERTY(bool canUndo READ canUndo NOTIFY canUndoChanged)
Q_PROPERTY(bool canRedo READ canRedo NOTIFY canRedoChanged)
-#ifndef QT_NO_IM
Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged)
-#endif
Q_PROPERTY(qreal contentWidth READ contentWidth NOTIFY contentSizeChanged)
Q_PROPERTY(qreal contentHeight READ contentHeight NOTIFY contentSizeChanged)
Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged)
@@ -205,10 +199,9 @@ 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);
@@ -257,12 +250,10 @@ public:
bool canUndo() const;
bool canRedo() const;
-#ifndef QT_NO_IM
bool isInputMethodComposing() const;
Qt::InputMethodHints inputMethodHints() const;
void setInputMethodHints(Qt::InputMethodHints hints);
-#endif
Q_INVOKABLE QString getText(int start, int end) const;
@@ -304,14 +295,10 @@ Q_SIGNALS:
void canPasteChanged();
void canUndoChanged();
void canRedoChanged();
-#ifndef QT_NO_IM
void inputMethodComposingChanged();
-#endif
void effectiveHorizontalAlignmentChanged();
void contentSizeChanged();
-#ifndef QT_NO_IM
void inputMethodHintsChanged();
-#endif
void renderTypeChanged();
protected: