diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 2269bde513..01cfc4034e 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2283,8 +2283,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: {