Showing Icon in vertical header of a table
Hi All,
I m using qt 4.2.2 on my mac intel.
I have created a tablewidget and using this code to show Icon in a vertical header to its original size
QSize size1(48,48);
QIcon a(":/images/nikon_logo.png");
a.actualSize(size1,QIcon::Active,QIcon::Off);
QTableWidgetItem *item=new QTableWidgetItem(a,"1",0);//set Icon a and string 1
tableWidget->setVerticalHeaderItem(0,item);
tableWidget->verticalHeaderItem(0)->setSizeHint(QSize(70,tableWidget->verticalHeaderItem(0)->sizeHint().height()));
but actually this is showing very small icon.
If anybode know how I can show largeIcon in VerticalHeader then plz tell me.
Thanks.
Re: Showing Icon in vertical header of a table
Did you try this ?
tableWidget->verticalHeader()->setIconSize( QSize(48, 48) );
Re: Showing Icon in vertical header of a table
There is no change in icon size.
Its not working.
Re: Showing Icon in vertical header of a table
Yes, I tried to play a little with itemviews methods, without success..
You should try those 2 ideas :
- Use a costum item delegate for the headerview, with your own settings.
- Subclass QHeaderView and provide your own header ;-)
Guilugi.
Re: Showing Icon in vertical header of a table
Quote:
Originally Posted by
guilugi
- Use a costum item delegate for the headerview, with your own settings.
QHeaderView is not a full-featured item view. It doesn't actually use item delegates for anything at all. One idea less to test.. ;)
Re: Showing Icon in vertical header of a table
Here is another one to test - use QPixmap instead of QIcon.
Re: Showing Icon in vertical header of a table
Quote:
Originally Posted by
wysota
Here is another one to test - use QPixmap instead of QIcon.
Thanks.
But still no change in Icon size.
I m taking image in pixmap and then adding it to icon but no change in icon size.
Re: Showing Icon in vertical header of a table
Quote:
Originally Posted by
vishal.chauhan
But still no change in Icon size.
In that case you have to reimplement the header and do the drawing yourself. Try searching this forum, there has recently been a simmilar issue brought up.