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:
parent
df8ecfa929
commit
7482bef085
@ -230,7 +230,7 @@ Item {
|
||||
property bool loadCompleted: false
|
||||
|
||||
Component.onCompleted: {
|
||||
rootItem = Utils.rootObject()
|
||||
rootItem = Utils.rootObject(this)
|
||||
loadCompleted = true
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
rootItem = Utils.rootObject()
|
||||
rootItem = Utils.rootObject(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user