标题:默认的QTreeWidgetItem的高度怎么设置 ?
作者:圣域天子
日期:2014-06-11 16:31
内容:
默认的QTreeWidgetItem的高度怎么设置 ?
#1 [纵刀少年 06-11 18:55]
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.
#2 [圣域天子 06-13 12:24]
这个设置是有问题的,非ITEM时,在苹果机上也会显示,但行高度不一样的
#3 [toby520 06-14 10:23]
你的说法就有问题,delegate本来就要重写至少2个函数一个叫做sizeHint的函数,里面可以控制每个item的高度,如果是非item当前不在delegate之列
#4 [圣域天子 06-14 21:29]
文字描述有点说不清楚,看图:
上面有内容的行高度是设置过的,
但下面没有QTreeWidgetItem的行,高度没法设置,但高度明显小于上面的高度吧
我就是问下面没有QTreeWidgetItem的,怎么设置高度呢?
#5 [a78460750 10-12 15:23]
使用QT样式设置试试
QTreeWidget::item
{
height:22px;
}