diff options
author | David Boddie <david.boddie@nokia.com> | 2011-05-13 15:55:50 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-05-13 15:55:50 (GMT) |
commit | 4adf280fb6bda8e519bf23606b841e040cb04fab (patch) | |
tree | 88eda2f4f5cf46c9e68fa4aea7ca832aaa6c65db /src/gui/text/qtextcontrol.cpp | |
parent | d9ef2f580bd78e658064e4fa3d0acf73b9c2a921 (diff) | |
parent | f32438ffccd8728143b93399e7cd251e72d23b55 (diff) | |
download | Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.zip Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.tar.gz Qt-4adf280fb6bda8e519bf23606b841e040cb04fab.tar.bz2 |
Merge branch '4.8'
Conflicts:
doc/src/declarative/whatsnew.qdoc
doc/src/examples/orientation.qdoc
doc/src/examples/webftpclient.qdoc
examples/declarative/ui-components/main/qml/pics/niagara_falls.jpg
src/corelib/global/qglobal.cpp
src/gui/text/qglyphs.cpp
src/gui/text/qplatformfontdatabase_qpa.cpp
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-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()) { |