QT中的treewidget的问题

QT中的treewidget的问题,第1张

TreeWidget->addTopLevelItem(itemCollect)//树添加一个顶部的节点

itemCollect->setExpanded(true)//此节点设为展开

程序循环。qt是一个1991年由QtCompany开发的跨平台C++图形用户界面应用程序开发框架的软件。并且该软件判断一个qtreewidgetitem有几层是程序循环的。并且该软件受到很多用户的喜欢。

那是因为点击QComboBox后QTreeWidget根据QComboBox的行高对QTreeWidget的行高做的修正。

void QTreeWidgetItem::setSizeHint ( int column, const QSize &size )

Sets the size hint for the tree item in the given column to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

This function was introduced in Qt 4.1.

(当没有设置Item大小的时候,Delegate 会根据item里的数据来调整item的大小)

做为一只程序猿你应该可以很轻松的略读这段帮助文档吧。

你可以使用setSizeHint对QTreeWidget的行高进行修改。

但是当要添加的窗口的最小大小超过了你设置的QSize以后。QTreeWidget就会使用所填加的窗口的大小。忽视我们设置的大小。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11451078.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-16
下一篇2023-05-16

发表评论

登录后才能评论

评论列表(0条)

    保存