[Qt-interest] Can't change the Icon size in the HeadView of QTableView!
Bo Thorsen
bo at fioniasoftware.dk
Wed Aug 25 09:07:30 CEST 2010
Den 25-08-2010 08:24, bob skrev:
> 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));
pi->setSizeHint(QSize(128, 128));
Bo.
--
Bo Thorsen, Fionia Software
Expert Qt and C++ developer for hire
Mail me if you need a hand with your Qt code
More information about the Qt-interest-old
mailing list