Results 1 to 3 of 3

Thread: make a flat QPushButton

  1. #1
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default make a flat QPushButton

    Hello!
    Do you know what property or method can help me to make a flat QPushButton?
    I tried with SetAttribute but no attribute could help me...neither the Flat() method helped because the button gets invisible...

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: make a flat QPushButton

    This, I think, depends on how the style paints a flat button.

    Hence, try setting a stylesheet

  3. #3
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: make a flat QPushButton

    I solved with the style sheets with only this row of code:
    Qt Code:
    1. button.setStyleSheet("background-color: white");
    To copy to clipboard, switch view to plain text mode 

    I ♥ Qt

Similar Threads

  1. How to show QPushButton as flat when it is checked
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 3rd August 2010, 10:07
  2. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  3. Flat Icon in a QToolBar
    By schall_l in forum Qt Programming
    Replies: 8
    Last Post: 23rd June 2009, 09:31
  4. Replies: 5
    Last Post: 14th April 2009, 08:27
  5. QPushbutton Flat property and icon appearance.
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2006, 08:30

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.