Hello everyone, I have a custom c++ model class which inherits from QAbstractListModel. And as a view I use GridView. So GridView constructs as many components as QAbstractListModel::rowCount(). But as a delegate I use a complex component. With "complex" I mean that it has animations.
property bool animate: false delegate: Rectangle { SequentialAnimation on color { running: view.animate loops: Animation.Infinite ColorAnimation { from: "blue"; to: "#33FFFF"; duration: 1200 } ColorAnimation { from: "#33FFFF"; to: "blue"; duration: 1200 } } } What I want to ask is, shall I move the common parts of the delegate one layer up and use binding and put up with the signal and slots mechanism overhead instead of constructing unnecessary animation objects for all model elements? delegate: Rectangle { color: view.delegateColorAnimation } property bool animate: false property color delegateColorAnimation SequentialAnimation on delegateColorAnimation { running: animate loops: Animation.Infinite ColorAnimation { from: "blue"; to: "#33FFFF"; duration: 1200 } ColorAnimation { from: "#33FFFF"; to: "blue"; duration: 1200 } } I know signal and slots mechanism overhead is negligible but I am confused because of the special syntax for animation (Animation on property). Is there still a binding mechanism running on the background? Or is there any magic? If there isn't any magic for this syntax, and updating the property still relies on the binding mechanism, probably the second option would be the better one? Thank you, Sina
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest