QML 动态视图排序教程

本教程展示了如何在不修改源模型的情况下对ListView 中的项目重新排序。它演示了如何使用拖放来重新定位视图中的单个项目,以及如何使用模型数据对视图中的所有项目进行动态排序。

教程章节:

  1. 简单的 ListView 和委托
  2. 拖动视图项
  3. 移动拖动的项目
  4. 排序项目

本教程中的所有代码均可在 Qt XML 的examples/quick/tutorials/dynamicview 目录中找到。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.