I have a custom button class derived from QPushButton.I want to draw a "/" over this button and some parts of "/" will be outside of this button.When I click on the button,it will emit a right click signal(actually I did signal-slot code and it works correctly).

I tried creating another custom button class and using qpainter with paintevent.But seems like actually it draws another button over my button,so I can't right click on the button under it.

How can I make this work?