首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QSlider增加句柄大小

QSlider增加句柄大小
EN

Stack Overflow用户
提问于 2017-12-07 17:42:35
回答 0查看 7.5K关注 0票数 5

我非常需要增加我的滑块的手柄大小,但是没有css选项可以做到这一点(styleSheet())。Qt文档中的默认示例对我也没有帮助。

我有一个这样的滑块:

我希望增加它的把手的高度,如下面的解释图片所示,但我不知道怎么做。也许唯一的方法就是继承QAbstractSlider的子类?

以下是我的代码中的样式表:

代码语言:javascript
复制
                "QSlider::groove:horizontal {"
                "border: 1px solid #999999;"
                "height: 32px;" /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
                "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);"
                "margin: 2px 0; }"
            "QSlider::handle:horizontal {"
                "background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);"
                "border: 1px solid #5c5c5c;"
                "width: 40px;"
                "margin: -20px 0;" /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
                "border-radius: 3px;}"
            );
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47691972

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档