Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSlider - How to change tick color?
Forum Updated to NodeBB v4.3 + New Features

QSlider - How to change tick color?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 5.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    asc139
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      stylesheet is the only option. You can look at "link":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qslider for customizing slider

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • A Offline
        A Offline
        asc139
        wrote on last edited by
        #3

        I've already been trying style sheets based on just that link but I cannot find any value that influences the tick color...

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          it's currently not possible to style the ticks with stylesheet!
          The implementation is just missing (see QStyleSheetStyle::drawComplexControl() implementation).

          Edit:
          Also see "this ":https://bugreports.qt-project.org/browse/QTBUG-3564 and "this ":https://bugreports.qt-project.org/browse/QTBUG-3304 bug-report.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved