quick: Fix QtQuick not reacting to parent change events

- We were calling event() directly, which skiped event filters.
- The handler was calling parent(), but the setParent() call is done
later. So first call setParentItem()
This commit is contained in:
Sergio Martins
2020-10-09 19:09:45 +01:00
parent fad03f8e0b
commit 63279c187e
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ void QWidgetAdapter::itemChange(QQuickItem::ItemChange change, const QQuickItem:
switch (change) {
case QQuickItem::ItemParentHasChanged: {
QEvent ev(QEvent::ParentChange);
event(&ev);
qApp->sendEvent(this, &ev); // Not calling event() directly, otherwise it would skip event filters
Q_EMIT parentChanged();
break;
}