diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-23 14:44:31 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-29 11:10:27 +0000 |
commit | b169b5a4f36c4c8bd0acb5d91dec2e5d3f1e056d (patch) | |
tree | 8b2ad48d004268acd046e567fd3a2d7845d3fc59 /src/widgets | |
parent | 717724b17ac8e12ab06fe3820c0ac6349e971814 (diff) |
QPlainTextEdit: Take vertical offset into account when answering input method queries.
Determine offset point to similar to QTextEdit::inputMethodQuery()
and add an autotest.
Task-number: QTBUG-51923
Change-Id: I8232eb348063e2cd95d0632fe74a6eb30c897eda
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qplaintextedit.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 91788a3383..bb933362da 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -2198,15 +2198,15 @@ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property, QVarian break; default: v = d->control->inputMethodQuery(property, argument); - const QPoint offset(-d->horizontalOffset(), -0); + const QPointF offset = contentOffset(); if (v.type() == QVariant::RectF) - v = v.toRectF().toRect().translated(offset); + v = v.toRectF().translated(offset); else if (v.type() == QVariant::PointF) - v = v.toPointF().toPoint() + offset; + v = v.toPointF() + offset; else if (v.type() == QVariant::Rect) - v = v.toRect().translated(offset); + v = v.toRect().translated(offset.toPoint()); else if (v.type() == QVariant::Point) - v = v.toPoint() + offset; + v = v.toPoint() + offset.toPoint(); } return v; |