PDA

View Full Version : Custom Shaped QPushButton



frknml
6th December 2010, 14:11
Hi everyone;

I'm trying to change qpushbutton's shape,i want to change its shape like google maps navigation buttons.I repainted its shape but the problem is i can click outside the shape and my aim is also change its click region.If it's possible i need your suggestions.

Faruk

zgulser
6th December 2010, 14:28
Hi,

As far as I know there are two ways to do it. One way to implement "google-maps" like button is first using regular QT's QPushButton and playing it's css like padding, border etc. Secondly, you may implement your own QPushButton like;

MyPushButton: public QPushButton {...} and reimplement drawControl() method.

I suggest you to go through with the first method since latter one is far difficult to implement

Zeki