diff options
author | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-02-03 15:36:12 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2016-02-04 08:14:39 +0000 |
commit | 75b705fec8e9517047d7dfa98203edff69f2bf8a (patch) | |
tree | a186ba74823ccc36b28e281b3eccdd298fbdc87a | |
parent | 00266882855233591d98b7a200afba4f216a978b (diff) |
End the drag if the dockwidget is being hidden
When the window flags are changed for the widget then it is possible to
minimize the dockwidget via the titlebar. This will cause it to be ready
to start a drag internally but since the dockwidget never gets a mouse
release event it doesn't end it. Therefore it ends up being in an invalid
state later on when restored, so the endDrag() needs to happen in the hide
event to ensure this is not an issue later on.
Change-Id: Ia84bee96b9eed49896869e6a15d4de6d01964264
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r-- | src/widgets/widgets/qdockwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 67eb466ba8..481fcdac12 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1445,6 +1445,8 @@ bool QDockWidget::event(QEvent *event) switch (event->type()) { #ifndef QT_NO_ACTION case QEvent::Hide: + if (d->state) + d->endDrag(true); if (layout != 0) layout->keepSize(this); d->toggleViewAction->setChecked(false); |