Results 1 to 3 of 3

Thread: QSlider - How to change tick color?

  1. #1

    Default QSlider - How to change tick color?

    Hi,

    I'm looking for a way to change tick colors for a QSlider which uses TicksBothSides.
    Can anyone tell me how to do this (hopefully without having to reimplement the paintEvent()).

    Best,
    asc

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSlider - How to change tick color?

    Did you try to use QPalette? (with QPalette::WindowText)
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSlider - How to change tick color?

    Hi, you can also try style sheets: example

    Ginsengelf

    edit: it seems like you cannot change the tick color using style sheets.
    Last edited by Ginsengelf; 20th January 2014 at 13:39. Reason: updated contents

Similar Threads

  1. Replies: 2
    Last Post: 29th September 2011, 13:10
  2. QSlider - how to color the space
    By newb in forum Qt Programming
    Replies: 6
    Last Post: 20th July 2010, 09:51
  3. qslider fixed to tick marks
    By holst in forum Qt Programming
    Replies: 4
    Last Post: 24th July 2009, 12:18
  4. QSlider with tick marks numbers
    By mastupristi in forum Qt Programming
    Replies: 3
    Last Post: 6th July 2009, 08:32
  5. QSlider with a custom set of labels for the tick marks?
    By whitefurrows in forum Qt Programming
    Replies: 3
    Last Post: 5th August 2007, 16: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.