Fix crash in QSimpleDrag if drag wasn't started over a QWindow
The code in QSimpleDrag::startDrag() checks for the validity of the current window before passing it on to QWindowSystemInterface::handleDrag(), and so should QSimpleDrag::cancel(). Change-Id: I2228d86ede2a0b8379a55000a5c1d830cab44d45 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
14aae25d03
commit
02b18343e1
@ -324,9 +324,10 @@ void QSimpleDrag::startDrag()
|
||||
void QSimpleDrag::cancel()
|
||||
{
|
||||
QBasicDrag::cancel();
|
||||
if (drag())
|
||||
if (drag() && m_current_window) {
|
||||
QWindowSystemInterface::handleDrag(m_current_window, 0, QPoint(), Qt::IgnoreAction);
|
||||
m_current_window = 0;
|
||||
m_current_window = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void QSimpleDrag::move(const QMouseEvent *me)
|
||||
|
Loading…
Reference in New Issue
Block a user