Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. StyleSheet for custom widget inherited from `QSlider`
Qt 6.12 LTS is out! See what's new in the release blog

StyleSheet for custom widget inherited from `QSlider`

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 436 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.
  • Please_Help_me_DP Offline
    Please_Help_me_DP Offline
    Please_Help_me_D
    wrote on last edited by
    #1

    Hi,

    I'm trying to apply stylesheet to the custom widget ctkRangeSlider.

    It is a slider with two control ticks and it inherits QSlider. Below the picture of it.

    Using QSlider::groove:horizontal I can change the color of grey part (using QSlider::groove:horizontal) in the picture. But I can't change the blue part of ctkRangeSlider to the orange like in the QSlider.

    d99b70e7-87a0-4d49-9889-3ce35c757b90-image.png
    7036702c-8722-42cc-b3ef-d61f5ad61a87-image.png

    
    QSlider::groove:horizontal {
    	height: 5px;
    background: rgb(181,181,181);
    }
    
    QSlider::handle:horizontal {
    	background: #b1b1b1;
    	border-style: solid;
    	border-width: 1px;
    	border-color: rgb(207,207,207);
    	width: 6px;
    	margin: -5px 0;
    	border-radius: 2px;
    }
    
    QSlider::add-page:horizontal {
      background: rgb(181,181,181);
    }
    
    QSlider::sub-page:horizontal {
      background-color: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f);
    }
    
    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
    • Unsolved