help QSlider styling add_page and inverted appearanceI've u



  • I've used the following CSS to style a vertical slider:

    QSlider::sub-page:vertical {
    	background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1, stop: 0 #1a7adc, stop: 1 #57a6f4);
    	border: 1px solid #202020;
    	width: 8px;
    	border-radius: 2px;
    }
    

    I have a vertical slider though in my GUI where in QT Creator I've checked "invertedAppearance" in the properties. For this slider though, the application of the style-sheet seems to undo the "inverted appearance" (the slider still functions "inverted" as expected, but the wrong side of the groove is colored)

    If I change "sub-page" to "add-page" in the above, then my "inverted" slider gets the proper side of the groove colored, but the "normal" sliders are then backward.. If I specify colors for both sub-page and add-page, then both sides of all sliders are colored which isn't the desired effect either.

    How can I define the "add-page" color for the normal vertical slider while specifying the "sub-page" color for the "invertedAppearance" slider?

    Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.