QTreeWidget 展开标志 [英] QTreeWidget expand sign

查看:23
本文介绍了QTreeWidget 展开标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使项目没有任何子项目,如何使 QTreeWidget 中的可扩展标志始终可见?以及如何绘制其他东西而不是默认符号?

How to make expandable sign in QTreeWidget always visible even when item doest have any subitems? And how to draw something else instead of default sign?

提前致谢,塞尔吉

推荐答案

QTreeWidgetItems 具有 property childIndicatorPolicy.允许的值为:

QTreeWidgetItems have the property childIndicatorPolicy. The allowed values are:

  • QTreeWidgetItem::ShowIndicator
  • QTreeWidgetItem::DontShowIndicator
  • QTreeWidgetItem::DontShowIndicatorWhenChildless

你想要第一个.

theItem.setChildIndicatorPolicy(QTreeWidgetItem.ShowIndicator)

这篇关于QTreeWidget 展开标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆