Minor: add an assert

Provides a nicer backtrace when it happens.
Currently repro on QtQuick only
This commit is contained in:
Sergio Martins
2020-11-17 21:04:32 +00:00
parent f13de89db5
commit 774e66ba6f

View File

@@ -556,8 +556,10 @@ bool DragController::eventFilter(QObject *o, QEvent *e)
case QEvent::MouseButtonPress:
// For top-level windows that support native dragging all goes through the NonClient* events.
// This also forbids dragging a FloatingWindow simply by pressing outside of the title area, in the background
if (!KDDockWidgets::usesNativeDraggingAndResizing() || !w->isWindow())
if (!KDDockWidgets::usesNativeDraggingAndResizing() || !w->isWindow()) {
Q_ASSERT(activeState());
return activeState()->handleMouseButtonPress(draggableForQObject(o), Qt5Qt6Compat::eventGlobalPos(me), me->pos());
}
else break;
case QEvent::MouseButtonRelease:
case QEvent::NonClientAreaMouseButtonRelease: