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. help QSlider styling add_page and inverted appearanceI've u
Qt 6.11 is out! See what's new in the release blog

help QSlider styling add_page and inverted appearanceI've u

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

    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

    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