Results 1 to 2 of 2

Thread: Custom Shaped QPushButton

  1. #1
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Custom Shaped QPushButton

    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

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Custom Shaped QPushButton

    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;
    Qt Code:
    1. MyPushButton: public QPushButton {...}
    To copy to clipboard, switch view to plain text mode 
    and reimplement drawControl() method.

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

    Zeki

Similar Threads

  1. QPushButton with a custom QLabel
    By shadyabhi in forum Newbie
    Replies: 9
    Last Post: 13th August 2015, 04:56
  2. Round Icon shaped QPushButton Click event
    By kcsomisetty in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th June 2010, 07:52
  3. custom shaped buttons
    By jsabater in forum Qt Programming
    Replies: 5
    Last Post: 2nd July 2009, 15:17
  4. Custom-Shaped Widget
    By [Po]lentino in forum Newbie
    Replies: 2
    Last Post: 9th April 2009, 23:41
  5. Custom shaped forms and controls
    By AlbertGoodwill in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2007, 07:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.