In QML, how can I prevent a child element from inheriting the opacity from its parent? I want to set different opacity values for the parent and it\'s child element.
It's possible! You need to test in the Component.onCompleted scope the opacity of the parent. If its 0 you need to change the parent of your object to the parent of it's current parent.
Example:
Item{
id:root
Item{
id:currentParent
opacity: 0
Item{
id:item
Component.onCompleted:{
if(parent.opacity === 0)
item.parent = currentParent.parent
}
}
}
}