Re: custom shaped buttons
I wonder if u really searched ;)
Even with the same heading as your thread - "Custom shaped button" I could find this.
Also if u had seen shaped clock example in Qt Demo, it will give you a good idea.
Re: custom shaped buttons
My problem is when clicking the "non-visible" regions of the widget.
The button is displaying fine... I already had a look in the forum and there is nothing with "hitButton"
Regards
Re: custom shaped buttons
try
int qAlpha ( QRgb rgba )
Code:
bool GuiButton
::hitButton ( const QPoint & pos
) const {
//QColor mcolor = icon().pixmap(iconSize()).alphaChannel().toImage().pixel(pos);
if ( qAlpha (icon().pixmap(iconSize()).alphaChannel().toImage().pixel(pos))== 0)
return false;
else
return true;
}
Re: custom shaped buttons
Quote:
My problem is when clicking the "non-visible" regions of the widget.
Did you come across QWidget::setMask in those posts ?
Re: custom shaped buttons
Thanks MrDeath and aamer4yu for your replies,
Unfortunately none helped.
When clicking in the transparent region of the Widget (also using "setMask") the widget emits de PRESSED signal.
Any other hint how to use "hitButton"?