Pass item to rootObject() since it's now a singleton

The "parent" used to be resolved by the place where the utils.js was imported from.
However, it was changed into a singleton and now this didn't work.

BUG: 384776
This commit is contained in:
Kai Uwe Broulik 2017-09-18 15:11:09 +02:00
parent df8ecfa929
commit 7482bef085
3 changed files with 4 additions and 4 deletions

View File

@ -230,7 +230,7 @@ Item {
property bool loadCompleted: false
Component.onCompleted: {
rootItem = Utils.rootObject()
rootItem = Utils.rootObject(this)
loadCompleted = true
}

View File

@ -277,7 +277,7 @@ Item {
}
Component.onCompleted: {
rootItem = Utils.rootObject()
rootItem = Utils.rootObject(this)
}
}
}

View File

@ -40,8 +40,8 @@
.pragma library
function rootObject() {
var next = parent
function rootObject(item) {
var next = item.parent
while (next && next.parent)
next = next.parent
return next