项目视图示例

展示树形模型编辑器的应用程序

Qt 提供了许多功能,可以以不同方式显示预定义和用户定义的项目模型。模型/视图架构所引入的功能分离,使开发人员能够更灵活地自定义项目的呈现方式。

Address Book

通讯录示例展示了如何使用代理模型,基于单一模型的数据显示不同的视图。

Basic Sort/Filter Model Example

“基本排序/过滤模型”示例演示了如何使用 QSortFilterProxyModel 来执行基本的排序和过滤操作。

Combo Widget Mapper Example

“下拉列表控件映射器”示例展示了如何使用 QDataWidgetMapper 将模型中的信息映射到表单上的特定控件。

Custom Sort/Filter Model Example

“自定义排序/过滤模型”示例演示了如何通过继承 QSortFilterProxyModel 来实现高级排序和过滤。

Editable Tree Model Example

此示例展示了如何实现一个简单的基于项的树模型,该模型可与模型/视图框架中的其他类一起使用。

Fetch More Example

“Fetch More”示例展示了如何按需向项目视图模型中添加项目。

Frozen Column Example

此示例演示了如何在 QTableView 中固定一列。

Simple Tree Model Example

“简单树模型”示例展示了如何将分层模型与 Qt 的标准视图类结合使用。

Spreadsheet

“电子表格”示例展示了如何创建一个简单的电子表格应用程序。

Star Delegate Example

“Star Delegate”示例展示了如何创建一个能够自行绘制且支持编辑的委托。

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