If you don't tell the button it should paint itself round, you can't expect it to be round. Masking only makes some regions of it transparent, but it won't look good if you just cut holes in a regular push button.
If you don't tell the button it should paint itself round, you can't expect it to be round. Masking only makes some regions of it transparent, but it won't look good if you just cut holes in a regular push button.
I called drawButton() in Widget's paintEvent()
Following error occurs
error: ‘virtual void QPushButton::drawButton(QPainter*)’ is protected
How to resolve it ? Please help me
Thank You,
Manohar
You need to implement your own routine for drawing the button. Are you aware of what I'm telling you or are you just guessing? You need to draw a round button because the button is not round by default, so masking it will not make it round because it's rectangular.
Thanks ........
I am not getting what to write in DrawButton() slot to make round button....
If you give some hints .... I will try ...
Don't touch DrawButton()! Reimplement paintEvent(). There are lots of examples on how to do that in the docs.
Qt Code:
p.drawEllipse(rect()); }To copy to clipboard, switch view to plain text mode
I already reimplement paintEvent() in widget class ....
Its not working ....
You must have done it incorrectly then.
Please help me to correct that mistake ......
Thank You,
Manohar
Bookmarks