[Qt-qml] Qt-qmlquestion about how to assign a delegate
Wes Hardaker
qt at hardakers.net
Wed Dec 28 19:28:22 CET 2011
>>>>> On Wed, 28 Dec 2011 11:52:56 +0200, Sivan Greenberg <sivan at omniqueue.com> said:
...
SG> delegate: CategoryDelegate {}
SG> Notice the {} braces after the delegate assignment, now with the the
SG> braces the listview shows no content, so they are required.
A delegate must be a full Qml object. Frequently you'll see people do
simple examples by instantiating something like a Row {} object directly
in-line after "delegate:". But in the above example, it's loading the
object from the CategoryDelegate.qml file instead.
(yes, there are other methods of creating objects too, but in this case
it is in a qml file).
--
Wes Hardaker
My Pictures: http://capturedonearth.com/
My Thoughts: http://pontifications.hardakers.net/
More information about the Qt-qml
mailing list