[Qt-interest] Can't change the Icon size in the HeadView of QTableView!
bob
bob.li at i-soft.com.cn
Wed Aug 25 08:24:54 CEST 2010
Hi, All,
When i use QTableView, find can't change the icon size in the HeadView
of it. The core part of code as follow:
QTableView *pv = new QTableView();
QStandardItemModel* pm = new QStandardItemModel();
QStandardItem* pi = new QStandardItem(QIcon("./channel.png"), "hello");
//the size of png file is 128*128
pm->setHorizontalHeaderItem(0, pi);
pv->setModel(pm);
pv->setGeometry(100, 50, 400, 200);
pv->setParent(this);
QHeaderView *ph = pv->horizontalHeader();
ph->setFixedHeight(80);
ph->setIconSize(QSize(40,40));
I try to change the size of ph->setIconSize(QSize(40,40)); ,but the size
of icon don't do any change, why?
BTW:the version is qt-everywhere-opensource-src 4.6.2
Best Regards
More information about the Qt-interest-old
mailing list