PDA

View Full Version : TreeWidget + Icon, does not scale



giusepped
8th October 2009, 09:07
I used:


InverterCheck::InverterCheck(QWidget* parent) : QWidget(parent)
{
setupUi(this);
treeWidget->setColumnCount(4);
QList<QTreeWidgetItem *> items;


for (int i = 0; i < 10; ++i){
QTreeWidgetItem *it = new QTreeWidgetItem(treeWidget);
it->setIcon(3,QIcon(":/images/ledspento.png"));

it->setText(0,tr("Voc(Tmin)"));
it->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
items.append(it);
}
treeWidget->insertTopLevelItems(0, items);
}

in order to have an Icon in the forth column.
But the Icon will not be resized to the correct size. Do I have to resize "by hand" the icon's size, or QIcon can do it for me?
G