I would not recommend using delegates to create such a positioner item for the 
reasons you pointed out. The Row and Column positioners, essentially do the 
same as the splitter and do not have a cumbersome API. You might want to look 
at desktop components, as there is already a SplitterRow/Column component that 
does exactly this: http://qt.gitorious.org/qt-components/desktop/

Regards,
Jens Bache-Wiig

> Hi all,
> 
> I am trying to create components in QML similar to e.g. QSplitter. I
> would need to have a good way of assign the content to the splitter.
> Currently I am using the following:
> 
> Splitter.qml:
> 
> Item {
>  property alias firstDelegate: firstLoader.sourceComponent
>  property alias secondDelegate: secondLoader.sourceComponent
>  ...
>  Loader {
>    id: firstLoader
>  }
>  ...
>  Loader {
>    id: secondLoader
>  }
> }
> 
> If I use the solution above I am able to create the needed
> functionality, but using this is a bit difficult and the whole
> solution feels a bit cumbersome. The problems with its use surface
> when I would need to access the delegates from another component e.g.:
> 
> Splitter {
>  firstDelegate: Rectangle{id: firstRect}
>  secondDelegate: Rectangle{id: secondRect}
> }
> 
> Now if I want to access the first & secondRect, I cannot use their
> ids, because they are out of scope (?). What I can do is add
> properties for the Loader items to the Splitter component. The problem
> is that now I assign the delegate using one property and access it
> using another, which can make the code hard to understand and also
> increase the possibility of mistakes. Another problem that I've had
> has been accessing the properties of the delegates (don't know exactly
> what is causing this as have not solved the issues fully yet).
> 
> So to my question: How should I implement such components? Does it
> make any sense to use a Loader component for this?
> 
> Cheers,
> Miko Kiiski
> _______________________________________________
> Qt-qml mailing list
> Qt-qml@qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml

_______________________________________________
Qt-qml mailing list
Qt-qml@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to