开发者

QT QSlider Margins

开发者 https://www.devze.com 2023-02-18 02:36 出处:网络
I\'m making a widget that consists of a QGridLayout which maps out a QSlider and a few QPushButtons. In my widget, I\'m able to position the buttons against the rightmost side of the container widget.

I'm making a widget that consists of a QGridLayout which maps out a QSlider and a few QPushButtons. In my widget, I'm able to position the buttons against the rightmost side of the container widget. The slider, however, is a bit more problematic.

I want the slider to be positioned such that the groove and handle extend all the way over to the point where the handle can be positioned flush against the widget boundary. I've tried a few things including changing the stylesheet margin properties for the gr开发者_运维技巧oove and messing with the functions provided by QGridLayout, but I can't seem to figure out how to accomplish this.

Does anyone have any suggestions?


I discovered that there is no easy, reliable method of ensuring that a QSlider be dynamically sizeable within a QGridLayout.

The best way of implementing a widget like this that I've found was to place the labels using QWidget::move(x,y) and using coordinates relative to the slider's size/position.

0

精彩评论

暂无评论...
验证码 换一张
取 消