QtQuick:更改树视图中的展开图标
QtQuick: Change expand icon in TreeView
我想在树视图中交换标准展开图标,可以吗?我想我需要为图像定义状态。
您可以在TreeViewStyle
中提供branchDelegate
,并使用styleData.isExpanded
来确定其状态。例如
TreeView {
style: TreeViewStyle {
branchDelegate: Rectangle {
width: 15; height: 15
color: styleData.isExpanded ? "red" : "green"
}
}
//...
}
相关文章:
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 视图中的参数推导失败:take_while
- 如何维护资源管理器项目视图中当前可见的项目列表
- 在另一个类视图中添加最多2个图表的正确方法是什么
- OpenVR:向视图方向移动
- 使用 WIN32 API (C/C++) 对特定树视图项进行着色
- 将所选值(通过视图)从 boost::multi_array 复制到另一个数组 (C++)
- 如何在不使用滚动条的情况下使视图更改
- 列表视图更改选择颜色
- 如何为 C++ Visual Studio 2019 指定应用程序图标?
- Qt - QVector 和模型视图 - 从列表视图获取自定义类的最佳方法是什么?
- 从 wxWidgets 中的.DLL加载图标
- 如何修复加载图标()函数不显示图标?
- 在 Qml 中从 QSqlTableModel 中删除单行时视图不一致
- QT Framewrok 和 Visual Studio - 图标冲突
- 如何在 c++ 中将图标放在按钮上?
- Visual Studio 2015资源视图和资源编译器使用不同的方法在项目目录中查找图标文件.如何修复
- с++ Microsoft MFC 树视图图标
- QtQuick:更改树视图中的展开图标
- 列表视图-资源管理器如何在小图标视图中获得相同大小的所有项目