Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

styling Slider need help, color on half based on position



  • I want to style the slider similar to this
    3d1ea5e1-c5c4-403e-b458-bc55af2dbd5b-image.png
    wherein the color is different on both halfves of the slider based on the position.

    How do you think i can achieve this?


  • Lifetime Qt Champion

    Hi,

    I think you should be able to do what you want with a stylesheet like:

    QSlider::sub-page
    {
        background: rgb(0, 0, 255);
    }
    
    QSlider::add-page 
    {
        background: rgb(128, 128, 128);
    }
    

    Adjust the color to your liking.


Log in to reply