summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-27 05:43:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-27 05:43:57 (GMT)
commitf8fea6f3b8fd3a1baa256130b23efc9e67a40e21 (patch)
treec9eee3ff39000816113bcab3a5c035da97c2a9fc /src/gui/text/qtextcontrol.cpp
parent415951891cd75170f1e4b89b46effa3319b56e4e (diff)
parent47712d1f330e4b22ce6dd30e7557288ef7f7fca0 (diff)
downloadQt-f8fea6f3b8fd3a1baa256130b23efc9e67a40e21.zip
Qt-f8fea6f3b8fd3a1baa256130b23efc9e67a40e21.tar.gz
Qt-f8fea6f3b8fd3a1baa256130b23efc9e67a40e21.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Ignore changes to selectByMouse during a selection. PathView offset out of sync with currentIndex when items are removed.
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index bee4d95..3fd3ab5 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1518,7 +1518,7 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();
- mousePressed = true;
+ mousePressed = (interactionFlags & Qt::TextSelectableByMouse);
#ifndef QT_NO_DRAGANDDROP
mightStartDrag = false;
#endif
@@ -1607,13 +1607,11 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
if (!(buttons & Qt::LeftButton))
return;
- const bool selectable = interactionFlags & Qt::TextSelectableByMouse;
const bool editable = interactionFlags & Qt::TextEditable;
- if (!selectable && !editable)
- return;
-
if (!(mousePressed
+ || editable
+ || mightStartDrag
|| selectedWordOnDoubleClick.hasSelection()
|| selectedBlockOnTrippleClick.hasSelection()))
return;
@@ -1627,7 +1625,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
return;
}
- if (!selectable)
+ if (!mousePressed)
return;
const qreal mouseX = qreal(mousePos.x());
@@ -1695,10 +1693,8 @@ void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, c
if (mousePressed) {
mousePressed = false;
#ifndef QT_NO_CLIPBOARD
- if (interactionFlags & Qt::TextSelectableByMouse) {
- setClipboardSelection();
- selectionChanged(true);
- }
+ setClipboardSelection();
+ selectionChanged(true);
} else if (button == Qt::MidButton
&& (interactionFlags & Qt::TextEditable)
&& QApplication::clipboard()->supportsSelection()) {