Results 1 to 13 of 13

Thread: Removing gradient from QPushButton

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Removing gradient from QPushButton

    What happens if you overload the style for different states of the button like :hover?


    QPushButton, QPushButton:hover { background: white; color: black; }

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

    Default Re: Removing gradient from QPushButton

    Quote Originally Posted by wysota View Post
    What happens if you overload the style for different states of the button like :hover?


    QPushButton, QPushButton:hover { background: white; color: black; }
    Sorry for not getting back to this sooner. Been focused on other projects.

    If I overload for :hover, with the above sytnax, using the Plastique style I still don't get a solid color background in the button, it's a white to grey gradient. I get similar results if I overload for :pressed with the same syntax.

    So I'm using a qlineargradient to get a solid color background for my QPushButton, when using the Plastique style.

    From my testing this only appears to happen with the Plastique style and not with any other sytle that I tried.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Removing gradient from QPushButton

    This might be a bug in stylesheets or plastique.

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

    Default Re: Removing gradient from QPushButton

    Quote Originally Posted by wysota View Post
    This might be a bug in stylesheets or plastique.
    Along the lines of what I was thinking.

    It's as if the QStyle is being applied no matter what I specify in the style sheet, when the plastique style is used. Other styles I tried, behaved as I expected when stylesheets were used to modify the look of the QPushButton.

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
  •  
Qt is a trademark of The Qt Company.