[Qt-qml] question about how to assign a delegate

Sivan Greenberg sivan at omniqueue.com
Wed Dec 28 10:52:56 CET 2011


Hi All,

 I've been recently playing with the wonderful RSS reader example that
is shipped with Creator part of the SDK, and I noticed (in contrast
with old examples) that the delegates in the example are assigned as
such:

    ListView {
                focus: true
                id: categories
                anchors.fill: parent
                model: rssFeeds
                footer: quitButtonDelegate
                delegate: CategoryDelegate {}
                highlight: Rectangle { color: "steelblue" }
                highlightMoveSpeed: 9999999
            }

Notice the {} braces after the delegate assignment, now with the the
braces the listview shows no content, so they are required. Has this
changed in QML over the last months or just something I overlooked ?
What's the semantic meaning of that? Perhaps this means to
"instantiate" the delegate and have the delegate property reference
it? (Much like you do in Python, where you do obj = Object())

Answers welcome, thanks in advance,

-- 
-Sivan


More information about the Qt-qml mailing list