PDA

View Full Version : How to hide the area around a icon in a toolbar button



merry
19th March 2010, 04:50
Hi,

I want to hide the area around a icon in the toolbarbutton.
Please help?

aamer4yu
19th March 2010, 05:24
I want to hide the area around a icon in the toolbarbutton.
You mean icons with transparent borders,,, isnt it ?

I guess the icons you are using have opaque borders.

merry
19th March 2010, 05:42
you can take it like this ,
suppose i have a toolbutton of size 50 ,40
and a icon in that of size 20, 20 .........
Now i want to hide the area of the button which doesn't contain icon.........

aamer4yu
19th March 2010, 05:46
If you hide that area, wont the size of the button reduce to 20,20 ??
So you can either resize the button to fit the icon, or you can resize the icon to fit the button.

Also may be QWidget::setMask might be of some use to you.

merry
19th March 2010, 05:50
Actually the height of Toolbutton is controlling the height of my toolbar ,which i can't compromise with .
So i can't change the size.
QWidget::setMask() is not working for me.

aamer4yu
19th March 2010, 06:33
What did you try with setMask ? you need to apply mask on the toolbutton.
I guess simplest way would be using a png/jpg with transparent backgroung.
If this is not what you want, can you some snapshot of what functionality you want to achieve ?