Is it possible to get the x and y of a QSlider's handle?
-
not directly, but you should be able to approximate it from the slider's value() and the geometry of the slider widget.
Keep in mind that for a horizontal slider only the X would be relevant, and for vertical only the Y would be relevant.
Perhaps you can tell me why you need it?Otherwise I'd suggest you create your own custom slider to implement what you want.
-
not directly, but you should be able to approximate it from the slider's value() and the geometry of the slider widget.
Keep in mind that for a horizontal slider only the X would be relevant, and for vertical only the Y would be relevant.
Perhaps you can tell me why you need it?Otherwise I'd suggest you create your own custom slider to implement what you want.
@Kent-Dorfman I have this unfinished animation to indicate which slider settings frame you're on. I think it would look better if instead of the animation underlaying behind the entire QSlider, I could make a similar animation only focusing on the slider's handle, but I need to track the coordinates of the handle for that
-
don't try it using the canned QSliders. You will have to make your own custom slider. Even approximating the handle position will be hit or miss because different themes will hork with the slider geometry.
-
don't try it using the canned QSliders. You will have to make your own custom slider. Even approximating the handle position will be hit or miss because different themes will hork with the slider geometry.
@Kent-Dorfman said in Is it possible to get the x and y of a QSlider's handle?:
different themes will hork with the slider geometry.
There QStyle::subelemtRect() can help.
-
don't try it using the canned QSliders. You will have to make your own custom slider. Even approximating the handle position will be hit or miss because different themes will hork with the slider geometry.
@Kent-Dorfman I'm setting the style
app.setStyle(QStyleFactory.create('windowsvista'))
like this, and since I'm using a Windows only audio control library, I don't really care for other OS'es