diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-08-03 16:50:24 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-06 09:06:24 +0200 |
commit | 35c8ad7957aed842e1aba60df96e50c5e2dcf133 (patch) | |
tree | 78594d3984716574eb289c773ad286260d6031c4 /src/quick/items/qquicktextcontrol.cpp | |
parent | 082dff2c8f5383e8372c1a4d7c61bc2eebe5c9df (diff) |
Fix pasting with the middle button in TextInput and TextEdit.
Neither item accepted the middle button which prevented the mouse events
ever reaching them.
Change-Id: Ia8f693099df4d6c248976453d554fef96d1d3b33
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index af3f509f5b..dc61b36d4e 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -974,7 +974,7 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po { Q_Q(QQuickTextControl); - mousePressed = (interactionFlags & Qt::TextSelectableByMouse); + mousePressed = (interactionFlags & Qt::TextSelectableByMouse) && (e->button() & Qt::LeftButton); mousePressPos = pos.toPoint(); if (sendMouseEventToInputContext(e, pos)) @@ -989,7 +989,9 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po cursor.clearSelection(); } } - if (!(e->button() & Qt::LeftButton)) { + if (e->button() & Qt::MiddleButton) { + return; + } else if (!(e->button() & Qt::LeftButton)) { e->ignore(); return; } else if (!(interactionFlags & (Qt::TextSelectableByMouse | Qt::TextEditable))) { |