diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-27 09:27:52 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-27 09:27:52 (GMT) |
commit | 896db169ea224deb96c59ce8af800d019de63f12 (patch) | |
tree | 8350c36941ccfd74df35fb8a6a761edcbf042452 /src/gui/text | |
parent | 7a73de74fc517ff5722289cce4e4e754ff2417be (diff) | |
parent | f8fea6f3b8fd3a1baa256130b23efc9e67a40e21 (diff) | |
download | Qt-896db169ea224deb96c59ce8af800d019de63f12.zip Qt-896db169ea224deb96c59ce8af800d019de63f12.tar.gz Qt-896db169ea224deb96c59ce8af800d019de63f12.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/opengl/qwindowsurface_gl.cpp
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index faf4e77..4396730 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1519,7 +1519,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 @@ -1608,13 +1608,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; @@ -1628,7 +1626,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons return; } - if (!selectable) + if (!mousePressed) return; const qreal mouseX = qreal(mousePos.x()); @@ -1696,10 +1694,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()) { |