Results 1 to 5 of 5

Thread: Qt Style Sheet Vs Code

  1. #1
    Join Date
    Feb 2011
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt Style Sheet Vs Code

    Hi All,
    I want to do same effect as the style sheet do, through the code can it be possible? .
    I explain the problem .Suppose for QPush Button there are different states (pseudo) like Hover checked etc .In the Qt Style sheet we can set the state and suppose change the background color . I want to do the same functionality through code Can it be possible

  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: Qt Style Sheet Vs Code

    Quote Originally Posted by Ashutosh2k1 View Post
    I want to do same effect as the style sheet do, through the code can it be possible? .
    Yes. The stylesheets make use of a special Qt Style (cpp code), so you can check out how it is done.

    I explain the problem .Suppose for QPush Button there are different states (pseudo) like Hover checked etc .In the Qt Style sheet we can set the state and suppose change the background color . I want to do the same functionality through code Can it be possible
    Yes.

  3. #3
    Join Date
    Feb 2011
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Style Sheet Vs Code

    Thanks
    Can u Tell me where i will get the code

  4. #4
    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: Qt Style Sheet Vs Code


  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Style Sheet Vs Code

    For changing background and other things through code, have a look at QPalette, and QWidget::setPalette

Similar Threads

  1. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 12:48
  2. How to set Style sheet for QCalendarWidget?
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2009, 22:36
  3. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  4. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22
  5. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13:05

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.