summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/itemviews/qheaderview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index 2a41b7e40a..ce885d2c81 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -2204,8 +2204,15 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
if (pos < 0)
return;
if (e->buttons() == Qt::NoButton) {
+#if !defined(Q_WS_MAC)
+ // Under Cocoa, when the mouse button is released, may include an extra
+ // simulated mouse moved event. The state of the buttons when this event
+ // is generated is already "no button" and the code below gets executed
+ // just before the mouseReleaseEvent and resets the state. This prevents
+ // column dragging from working. So this code is disabled under Cocoa.
d->state = QHeaderViewPrivate::NoState;
d->pressed = -1;
+#endif
}
switch (d->state) {
case QHeaderViewPrivate::ResizeSection: {