[Qt-interest] Can't change the Icon size in the HeadView of QTableView!
Ramesh
ramesh.bs at robosoftin.com
Wed Aug 25 09:04:26 CEST 2010
Ya,
Through delegate u return the size,
Take a look at delegate here
http://qt-articles.blogspot.com/2010/07/how-to-customize-listview-in-qt-usin
g.html
here, steps of how to make delegates and how to return size for the
delegates are given.
Hope it might be helpful for u
-----Original Message-----
From: bob [mailto:bob.li at i-soft.com.cn]
Sent: Wednesday, August 25, 2010 12:31 PM
To: Ramesh
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Can't change the Icon size in the HeadView of
QTableView!
>
> The icon size is depending on the items icon you insert, i.e
> QStandardItem* pi = new QStandardItem(QIcon("./channel.png"), "hello");
>
>
The changel.png's size is 128*128, but in the QHeadView, it's very small
and can't be changed,
Why QHeadView->setIconSize() can't work, but QTableView->setIconSize()
can work?
> Or another option is, use the delegate to return the icon size for your
> listview.
>
>
I don't familiar with delegate , but i will try it.
Thanks!
Bob
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of bob
> Sent: Wednesday, August 25, 2010 11:55 AM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] Can't change the Icon size in the HeadView of
> QTableView!
>
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> -----------------------------------------------
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not
an intended recipient, please notify the sender and delete all copies.
Emails to and from our network may be logged and monitored. This email and
its attachments are scanned for virus by our scanners and are believed to be
safe. However, no warranty is given that this email is free of malicious
content or virus.
>
>
>
-----------------------------------------------
Robosoft Technologies - Come home to Technology
Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
More information about the Qt-interest-old
mailing list