Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.6.2, 5.7.1, 5.9.1
-
None
-
Windows 7 SP1 x64 + VS2013, Linux Debian 9 x64
Description
When menu disapears QGraphicsScene emits focusItemChange with newFocusItem == 0.
Focus is cleared in function QGraphicsItemPrivate::setVisibleHelper() in 5.6.2:
if (hasFocus && scene) { // Hiding the focus item or the closest non-panel ancestor of the focus item QGraphicsItem *focusItem = scene->focusItem(); bool clear = true; if (isWidget && !focusItem->isPanel()) { do { if (focusItem == q_ptr) { clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true); break; } } while ((focusItem = focusItem->parentWidget()) && !focusItem->isPanel()); } if (clear) clearFocusHelper(/* giveFocusToParent = */ false, hiddenByPanel); }
If it has been done intentionally, the reason is not clear.