Fix crash introduced by 75b705fec8

This fixes the crash introduced by
75b705fec8. The drag only needs to be ended
on the hide if it is actually in the middle of dragging. This enables the
case of dragging the dock widget out with the mouse to continue to work.

Task-number: QTBUG-50890
Change-Id: I72309dd40ee670319f2ff607ae201c46f8de4652
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Andy Shaw 2016-02-05 00:06:48 +01:00
parent 1c7e1d99b7
commit 798e0064e9

View File

@ -1445,7 +1445,7 @@ bool QDockWidget::event(QEvent *event)
switch (event->type()) {
#ifndef QT_NO_ACTION
case QEvent::Hide:
if (d->state)
if (d->state && d->state->dragging)
d->endDrag(true);
if (layout != 0)
layout->keepSize(this);