Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.2
-
None
-
051a76c1d65d698f71dc75c89f91ae9021357eae
Description
The snippet below shows the c.width changes multiple times. Changing width will trigger further changes in dependent components, and this is visible in performance (especially when constructing delegates for ListView). Problem was noticed when a delegate implementation was changed to use anchor layout (as suggested by QML performance tips page) instead of direct bindings, and the "fixed" delegate was slower than the original.
import Qt 4.7 Rectangle { width: 480 height: 640 Image { id: l source: "http://qt.nokia.com/logo.png" anchors.left: parent.left anchors.top: parent.top fillMode: Image.PreserveAspectFit asynchronous: false height: 40 onWidthChanged: console.log("l.width " + width) } Rectangle { id: c anchors.left: l.right anchors.top: parent.top anchors.right: r.left height: 40 onWidthChanged: console.log("c.width " + width) color: "red" } Rectangle { id: r anchors.right: parent.right anchors.top: parent.top width: 40 height: 40 onWidthChanged: console.log("r.width " + width) color: "blue" } }