Nested data model

rysiek rysiek at hackerspace.pl
Wed Nov 13 10:30:51 UTC 2013


Dnia niedziela, 10 listopada 2013 23:47:35 Michał rysiek Woźniak pisze:
> Hi there,
> 
> I am trying to create a nested, tree-view like structure. I am trying to
> base on:
> http://www.codeproject.com/Articles/632795/QML-TreeModel-and-TreeView
> 
> However, I do not have QtQuick 2.0 (and the components that go with it).
> 
> Anyway, I have created the following code that... crashes both PlasMate and
> plasmoidviewer with the message:
> 
> "QDeclarativeComponent: Cannot create new component instance before
> completing the previous"
> 
> As soon as I comment-out the line:
>   model: subitems
> in the Repeater element, the plasmoid "works", but obviously does not
> display the sub-items.
> 
> Any suggestions?

Okay, I find an inelegant but working work-around: added a Timer to the 
Component, set to 1ms, and start() it in Component.onCompleted; in 
Timer.onTriggered I set the model.

I'm sure, however, there must be a more elegant solution.

-- 
Pozdr
rysiek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 316 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20131113/c7940d28/attachment.sig>


More information about the Plasma-devel mailing list