Results 1 to 11 of 11

Thread: QPushButton stylesheet problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPushButton stylesheet problem

    You can add a pressed and hover state to your style sheet to make it behave as you wish

    QPushButton { ... }
    QPushButtonressed {...}
    QPushButton:hover {...}
    QPushButton:disabled {...}

    You probably want to put in
    color: red;
    background: (whatever color you want)

  2. #2
    Join Date
    May 2006
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPushButton stylesheet problem

    Quote Originally Posted by ntp View Post
    You can add a pressed and hover state to your style sheet to make it behave as you wish

    QPushButton { ... }
    QPushButtonressed {...}
    QPushButton:hover {...}
    QPushButton:disabled {...}

    You probably want to put in
    color: red;
    background: (whatever color you want)
    I may be able to mimick the default QGtkStyle behaviour, but in case the application runs in a different Gnome environment with different theme settings it's look will not be consistent with other applications. So I don't like this approach although it may work.

  3. #3
    Join Date
    May 2006
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPushButton stylesheet problem

    These are the images that were posted above.
    Attached Images Attached Images

Similar Threads

  1. Problem with QPrintPreviewWidget
    By nifei in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2012, 01:18
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Replies: 1
    Last Post: 7th October 2007, 23:02
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.