how to reshape pushbutton??
hi all,
i want to reshape the qpushbutton according to the shape of image.
i used setIcon(qicon &) to set the image on pushbutton but it is setting the icon on a rectangular pushbutton.But i want the shape of pushbutton as of the image...
How to do it??
Re: how to reshape pushbutton??
have a look at QWidget::setMask.
Re: how to reshape pushbutton??
thnx for reply..
i tried setmask(),but still after using this,i got a black boundary of pushbutton ,when i pressed the qpushbutton....
i write the following code:
Code:
{
QPixmap image
(":/images/but_00.png");
button_close->setGeometry(100,100,image.width(),image.height());
button_close->setFlat(1);
QSize size
(image.
width(),image.
height());
button_close->setIconSize ( size );
button_close->setIcon(image);
button_close->setMask(image.mask());
}
Is something wrong in code??
or Is there any other way to do this??
plzz specify..