qmldom: fix filterUp of two owners

finding the qmlObject from a script value (owner) did fail due to a
bug in filterUp.

Change-Id: I924ae5cb5db0548332594a0b36081da620d661a3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fawzi Mohamed 2022-04-28 10:30:28 +02:00
parent f07c62d487
commit b42b2e2ab8
2 changed files with 3 additions and 2 deletions

View File

@ -486,10 +486,10 @@ DomItem DomItem::filterUp(function_ref<bool(DomType k, DomItem &)> filter, Filte
return it;
checkTop = true;
if (!domTypeIsOwningItem(k)) {
DomItem el = owner();
DomItem el = it.owner();
DomItem res;
k = DomType::Empty;
Path pp = pathFromOwner();
Path pp = it.pathFromOwner();
DomType k2 = el.internalKind();
if (filter(k2, el)) {
k = k2;

View File

@ -473,6 +473,7 @@ private slots:
{
DomItem width = obj1.field(Fields::bindings).key(QLatin1String("width")).index(0);
QCOMPARE(width.field(Fields::value).qmlObject(), obj1);
DomItem w = obj1.bindings().key(QLatin1String("width"));
QVERIFY(w.indexes() > 0);
QCOMPARE(w.indexes(), 1);