[Interest] Tired of QML
Alexander Dyagilev
alervdvcw at gmail.com
Sat Apr 15 15:59:59 CEST 2017
On 4/15/2017 4:37 PM, Oleg Evseev wrote:
>
> I do not understand why this code does not work:
>
> ListView{
>
> anchors.fill:parent
>
> model:downloadsModel
>
> header:DownloadListHeader{}
>
> delegate:DownloadListItem
>
> {
>
> preInfoColumnWidth:parent.header.preInfoColumnWidth
>
> }
> }
>
> parent.header seems to be not accessible as preInfoColumnWidth initializes with 0. :(
>
> Firstly, header property is not an item of header, but a component.
> headerItem property holds the header item created from the header
> component. Also parent.headerItem.preInfoColumnWidth will not work,
> cause delegate items will not be *direct *children of Listview.
> parent.parent.headerItem.preInfoColumnWidth will work, but better use
> idListview.headerItem instead this mess of parents.
Ohhh... That's what I was talking about. A more intuitive API or at
least an explicit explanation for newbies in the docs would be
appreciated..
>
> So, I've decided to stick with global properties and use them to
> set properties for both header and delegate. Works fine.
>
> I think it's better solution.
Now I think so too. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/b7a05b10/attachment.html>
More information about the Interest
mailing list