I Have been using the style sheets to edit custom states to make my own push button.

How can you use the setMask() feature to hide out the alpha areas of the picture used in the push button so when you click on a transparent area it does not set off the click?

Thanks!

heres my style sheet

Qt Code:
  1. QPushButton:enabled{
  2. border-image: url(:/Button1/triangle.png) 4 4 4 4 stretch stretch;
  3. }
  4.  
  5. border-image: url(:/Button1/normal.png) 4 4 4 4 stretch stretch;
  6. }
  7.  
  8. QPushButton:pressed {
  9. border-image: url(:/Button1/pressed.png) 4 4 4 4 stretch stretch;
  10. }
To copy to clipboard, switch view to plain text mode 

and this was what i tried in order to make the triangle alpha areas work, (to no success)
Qt Code:
  1. QPixmap pixmap(":/Button1/triangle.png");
  2. ui->pushButton->setMask(pixmap.mask());
To copy to clipboard, switch view to plain text mode 

I am aware that I could also create my own custom class which inherits from QLabel that recognizes clicks, however I'm still not too sure how to mask certain things


Help would be appreciated!
Thanks