Hi,
In the page: http://doc.qt.nokia.com/latest/qdecl...rformance.html
I’m not quite understand two points, would you please help me?
1. Opaque Items
Items hidden behind an opaque item incur a cost. If an item will be entirely obscured by an opaque item, set its opacity to 0. One common example of this is when a "details" page is shown over the main application view.
Question: If an item is hidden completely behind an opaque item, in my understand no drawing effort would be paid, why still need to set the opacity to 0?
2. Anchors vs. Binding
It is more efficient to use anchors rather than bindings to position items relative to each other. Consider this use of bindings to position rect2 relative to rect1:
Rectangle {
id: rect1
x: 20
width: 200; height: 200
}
Rectange {
id: rect2
x: rect1.x
y: rect1.y + rect1.height
width: rect1.width - 20
height: 200
}
This is achieved more efficiently using anchors:
Rectangle {
id: rect1
x: 20
width: 200; height: 200
}
Rectange {
id: rect2
height: 200
anchors.left: rect1.left
anchors.top: rect1.bottom
anchors.right: rect1.right
anchors.rightMargin: 20
}
Question: I can’t understand why using anchors is better than bindings, shouldn’t the performance would be better if the programmer already defined the x/y and/or other geometry data?
Thank you.



