Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 QML XmlListModel 对解析的 xml 数据进行排序,然后将其显示在列表视图中。
谢谢。
没有办法。显然 XmlListModel(在当前的 Qt Quick 1.0 中)不支持其 API 中的任何排序。如果我没记错的话,XPath 不支持任何排序,除非您将它与 XSLT 一起使用。如果 QML 有类似QSortFilerProxyModel以 XmlListModel 作为源的东西,这可能是一个解决方案。但是您可以实现它,尽管您将不得不处理非公共 Qt API。