[Interest] Tired of QML

Oleg Evseev ev.mipt at gmail.com
Sat Apr 15 15:37:23 CEST 2017


>
> 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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170415/4a135e76/attachment.html>


More information about the Interest mailing list