Results 1 to 13 of 13

Thread: Removing gradient from QPushButton

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Removing gradient from QPushButton

    Hello all,

    I'm new to QT and I apologize if this has been has been asked before but I can't see to find this info anywhere.

    using QT 4.3.3 on OpenSuse 10.3

    I have QpushButtons that are being dynamically created and added to a layout in a frame.
    How do I make a QPushButton not have a gradient for the background color? I'm setting the style sheet of the button to be:

    Qt Code:
    1. pushButton->setStyleSheet{"background-color: white; color:black;}";
    To copy to clipboard, switch view to plain text mode 

    and when I see the button on the screen it's not solid while with black text. The background is a white to grey gradient. I know I could create an all white image and use that as the background, but it seems like there should be a straight forward way to do this.

    So is there a way to do this using the style sheet or do I need another approach, like modifing the Brush in the control's palette.

    Thanks for your time.
    Last edited by Lexrst; 22nd April 2008 at 00:56. Reason: added code highlighting

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.