diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-02-21 09:58:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-18 09:59:20 +0100 |
commit | 68a9229a97d358639357f76cfb186bb61aa6ce92 (patch) | |
tree | 62e72015ffed78821d7f1a8b6d7124594867dbff /src/widgets/widgets | |
parent | b55e0ac57f95b79879bcd301ff3b7365d957acc2 (diff) |
Android input method improvements
Use the new inputmethod query API. and get rid of the hack where
we would move the cursor back and forwards to make sure that the
Android software keyboard noticed that the cursor had moved.
The android plugin now uses absolute positions instead of
position within the paragraph for all cursor handling (provided
that the control supports the new API).
Task-number: QTBUG-37511
Change-Id: I03463dbbcb4acbfa41e2eab06889d021d50da01f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qplaintextedit.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qplaintextedit.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index d51dce4765..beb44e602e 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -2185,6 +2185,13 @@ void QPlainTextEdit::scrollContentsBy(int dx, int /*dy*/) */ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const { + return inputMethodQuery(property, QVariant()); +} + +/*!\internal + */ +QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const +{ Q_D(const QPlainTextEdit); QVariant v; switch (property) { @@ -2192,7 +2199,7 @@ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const v = QWidget::inputMethodQuery(property); break; default: - v = d->control->inputMethodQuery(property, QVariant()); + v = d->control->inputMethodQuery(property, argument); const QPoint offset(-d->horizontalOffset(), -0); if (v.type() == QVariant::RectF) v = v.toRectF().toRect().translated(offset); diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h index 1fb4625fb1..54cd3e14ed 100644 --- a/src/widgets/widgets/qplaintextedit.h +++ b/src/widgets/widgets/qplaintextedit.h @@ -185,6 +185,7 @@ public: int blockCount() const; QVariant inputMethodQuery(Qt::InputMethodQuery property) const; + Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; public Q_SLOTS: |