有没有办法使用自定义委托作为每两个连续项目之间的分隔符ListView
就像header
and footer
特性?
A ListView
可以分为sections
,又名团体。该文档提供了一个很好的例子here https://doc.qt.io/qt-5/qml-qtquick-listview.html#section-prop.
基本上你定义了一个Component
,就像你做的那样Header
and Footer
,并将其设置在section.delegate
子财产。在代码中:
ListView {
id: view
[...]
section.property: "size" // <--- the splitting property name
section.criteria: ViewSection.FullString // <--- specify the way section is created (see the provided link)
section.delegate: sectionDelegate // <--- your delegate
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)