QComboBox中的滚动条如何变宽?

嵌入式乌托邦 2013-09-24 08:50:47
如题,当QComboBox中的元素过多时就会有垂直滚动条出现,但是这个滚动条太细了,在触摸屏上上拉下拉,一点也不方便,有什么办法加宽吗?
...全文
774 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
醉过方知酒烈 2013-09-25
  • 打赏
  • 举报
回复
"QScrollBar::vertical {border-radius: 0px; border: 2px solid #3c4041;background: grey;width: 16px;margin:16px 0 16px 0;}" "QScrollBar::handle:vertical {border-radius: 0px; background: #1d9cd3;min-height: 20px;}" "QScrollBar::add-line:vertical {border: 1px solid #3c4041;background: #3c4041;height: 16px;subcontrol-position: bottom;subcontrol-origin: margin;image: url(:/images/triangle_down.png);}" "QScrollBar::sub-line:vertical {border: 1px solid #3c4041;background: #3c4041;height: 16px;subcontrol-position: top;subcontrol-origin: margin;image: url(:/images/triangle_up.png);}" "QScrollBar::add-page:vertical {background: none;}" "QScrollBar::sub-page:vertical {background: none;}" 添加到你设置的样式表里,有你想要的
嵌入式乌托邦 2013-09-24
  • 打赏
  • 举报
回复
引用 5 楼 zhxianbin 的回复:
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qcombobox QComboBox::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid; /* just a single line */ border-top-right-radius: 3px; /* same radius as the QComboBox */ border-bottom-right-radius: 3px; } 这里面的 width 不知道是不是
那个width是修改右边小箭头那部分的宽度的。
zhxianbin 2013-09-24
  • 打赏
  • 举报
回复
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qcombobox QComboBox::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid; /* just a single line */ border-top-right-radius: 3px; /* same radius as the QComboBox */ border-bottom-right-radius: 3px; } 这里面的 width 不知道是不是
Inhibitory 2013-09-24
  • 打赏
  • 举报
回复
引用 3 楼 lutao614 的回复:
[quote=引用 2 楼 zhxianbin 的回复:] http://harmattan-dev.nokia.com/docs/platform-api-reference/xml/daily-docs/libqt4/stylesheet-reference.html
试过了,只能修改QComboBox的样式,可以让右边下拉的那部分变宽,但是里面的scroll bar的样式改不了。[/quote] 一看就是没好好看过QSS的,先去学习一下QSS怎么用,不是让你直接用人家的这个代码。
嵌入式乌托邦 2013-09-24
  • 打赏
  • 举报
回复
引用 2 楼 zhxianbin 的回复:
http://harmattan-dev.nokia.com/docs/platform-api-reference/xml/daily-docs/libqt4/stylesheet-reference.html
试过了,只能修改QComboBox的样式,可以让右边下拉的那部分变宽,但是里面的scroll bar的样式改不了。
狂风暴雨 2013-09-24
  • 打赏
  • 举报
回复
http://harmattan-dev.nokia.com/docs/library/html/qt4/stylesheet-reference.html#list-of-stylable-widgets 应该qss可以控制的。。去找下,

16,829

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧