inline comment improved
This commit is contained in:
parent
cbf6ef10b8
commit
c27c100d64
@ -1706,12 +1706,15 @@ void QskControl::itemChange( QQuickItem::ItemChange change,
|
|||||||
if ( oldWindow && ( oldWindow->activeFocusItem() == this ) )
|
if ( oldWindow && ( oldWindow->activeFocusItem() == this ) )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
When deleting the activeFocusItem inside of QQuickItem::polish
|
Removing an item from the scene might result in
|
||||||
we run into crashes because of QQuickWindow::activeFocusItem()
|
changes of the active focus item. Unfortunately the corresponding
|
||||||
becomes a dangling pointer being used at the end of
|
FocusIn/Out events are sent, while the item tree is in an
|
||||||
QQuickWindowPrivate::polishItems.
|
invalid state.
|
||||||
|
When having event handlers, that do modifications of the focus
|
||||||
|
( f.e. assigning the local focus, inside of a focus scope )
|
||||||
|
we might end up with having a dangling pointer for
|
||||||
|
oldWindow->activeFocusItem().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QQuickWindowPrivate::get( oldWindow )->clearFocusInScope(
|
QQuickWindowPrivate::get( oldWindow )->clearFocusInScope(
|
||||||
qskNearestFocusScope( this ), this, Qt::OtherFocusReason );
|
qskNearestFocusScope( this ), this, Qt::OtherFocusReason );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user