Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.8, 5.14.0
-
None
-
-
5c3b5efd40b3ab14cc6406a0dca62dfb14b03d46 (qt/qtbase/5.15)
Description
Compile and run sample.cpp attached.
Press right mouse button inside main window. You will see context menu.
Put focus on top-level spinbox and make any change to value.
Move mouse cursor to submenu, open it, and put focus to spinbox just appeard.
Make any change to value, and just move mouse cursor to empty space inside main window. In about 1...2 second program will crash.
If comment source line marked with comment, the crash will disappear.
After some investigations I found the line in Qt's source code, that leads to crash.
$QT_SRC\qtbase\src\widgets\kernel\qapplication.cpp:3789 (for 5.14.0 version)
This is inside function
void QApplicationPrivate::closePopup(QWidget *popup)
{ ... if (QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard grabForPopup(aw); ... }The variable QApplicationPrivate::popupWidgets becomes NULL in my test case.
I've changed the line to
if (QApplicationPrivate::popupWidgets && QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard
and crash disappeared.