diff options
author | Dan Cape <dcape@qnx.com> | 2015-10-06 14:00:15 -0400 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-10-19 11:01:07 +0000 |
commit | e56938b4bb244dfccdb78aed66c842d65fe64c14 (patch) | |
tree | 499cc82888e02da9261e5a86f62716001ba6e8df /src/widgets/widgets/qlineedit_p.cpp | |
parent | 9636d8bee055e03417d97a9f4f58d7074a753737 (diff) |
QLineEdit: Unable to drag selected text when aligned right or center
Created local inSelection function to modify the x value (similar to
xToPos()) before sending it to the control. Ran the QLineEdit test and
manually tested with AlignLeft, AlignRight and AlignCenter.
Change-Id: I088430580dc87f3cfff90c4cd9ff90e6ab215f57
Task-number: QTBUG-48495
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index a68f5a41ed..e6dd4b8f3b 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -70,6 +70,12 @@ int QLineEditPrivate::xToPos(int x, QTextLine::CursorPosition betweenOrOn) const return control->xToPos(x, betweenOrOn); } +bool QLineEditPrivate::inSelection(int x) const +{ + x -= adjustedContentsRect().x() - hscroll + horizontalMargin; + return control->inSelection(x); +} + QRect QLineEditPrivate::cursorRect() const { return adjustedControlRect(control->cursorRect()); |