Qt模型视图结构遇见的小问题
发布日期:2021-05-14 23:41:55 浏览次数:18 分类:精选文章

本文共 1581 字,大约阅读时间需要 5 分钟。

������������������������������������������������������������������������������������������SelectionMode ��������������������������������������������������������������������������������������������������������� Qt ������������������������

������������������������������������������������������ Access Functions ������������������������������������������������������������������������������������������������ Qtreeview ������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������

QDirModel model; // ������������������
QTreeView tree; // ������������
QListView list; // ������������
QTableView table; // ������������
tree.setModel(&model); // ������������������������������
list.setModel(&model); // ������������������������������
table.setModel(&model); // ������������������������������
tree.setSelectionMode(QAbstractItemView::MultiSelection); // ������������������
list.setSelectionModel(tree.selectionModel()); // ������������������
table.setSelectionModel(tree.selectionModel()); // ������������

������������������������������������������������������������������

上一篇:在Qt中进行txt文件输出时遇见的输出数据混乱现象与自我解决方法
下一篇:Qt中,将以png为格式的图片在按钮控件上显示

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年04月24日 17时16分50秒