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. Modify QSlider Groove visualisation
Forum Updated to NodeBB v4.3 + New Features

Modify QSlider Groove visualisation

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k 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.
  • B Offline
    B Offline
    Bowdzone
    wrote on last edited by
    #1

    Hi guys,
    I'm trying to create a QSlider for modifying a line thickness. Now my idea with this was to use the groove from the slider to represent the current thickness but it is giving me more trouble than it should.

    As there is no direct way to change the groove size, I tried doing that with stylesheets but the "height" or "width" property for QSlider::groove:horizontal by itself have no effect. This has also the problem that as soon as you change the appearance of the groove, the handle is not drawn anymore in the default style. As this is a cross-platform program which is using different styles in linux/windows I want to keep the default handle style.

    Now it is no problem at all to override the paintEvent() (which is called on each handle movement anyway) and simply draw a line according to the current slider value which works fine. But here I would just need to remove the existing groove. I'd really prefer to not copy the whole paint routine from the src for the different styles we're using.

    Does anyone have an idea? Any help is greatly appreciated.

    PS: We're using 4.6

    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