Results 1 to 3 of 3

Thread: Slider Style sheet

  1. #1
    Join Date
    Nov 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Question Slider Style sheet

    Hi
    I want to design a customized vertical slider. How can i do that.
    I like to give customized color or image to slider.
    Please provide some help

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Slider Style sheet

    Quote Originally Posted by sijithjames View Post
    Hi
    I want to design a customized vertical slider. How can i do that.
    I like to give customized color or image to slider.
    Please provide some help
    You have 2 options.
    1. Use style sheet.
    2. Use QStyle (Create your own style by subclassing QStyle.)

  3. #3
    Join Date
    Mar 2008
    Posts
    52
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Slider Style sheet

    Hi
    Using style sheet you can easily change your slider
    Qt Code:
    1. QSlider::groove:vertical { background-image: url(:/new/prefix1/SliderTruckFullSpk.png); left: 0px; right:0px; /* absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... */}
    2. QSlider::handle:vertical {height:17px;width:17px; background-image: url(:/new/prefix1/speakerindicator_Idle.png); left: 1px; right: 0px;top:0px;bottom:4px; }
    3. QSlider::sub-page:vertical { background-image: url(:/new/prefix1/SliderTruck.png);left: 0px; right:0px; }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QTabWidget transparent background problem
    By destroyar0 in forum Qt Programming
    Replies: 10
    Last Post: 25th June 2009, 12:19
  2. How to set Style sheet for QCalendarWidget?
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2009, 22:36
  3. QMenu style sheet: works in dev env, breaks in release
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2008, 19:18
  4. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  5. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22

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.