c++ - 框架的 QTabWidget 圆角(不是标签)
问题描述
我怎样才能使 QTabWidget 的角变圆?不是制表符,而是框架(?)
我试过了:
QTabWidget{
border-radius: 7px;
}
但它不起作用。
选项卡的 QSS:
QTabBar::tab {
background-color: qlineargradient(x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(253,250,250), stop:0.2 rgb(253,250,250), stop:1 rgb(255,249,234));
border-top-left-radius: 7px;
border-top-right-radius: 7px;
min-width: 8ex;
padding: 5px;
}
QTabBar::tab:selected {
background-color: rgb(253,250,250);
}
QTabBar::tab:!selected {
margin-top: 5px;
background: qlineargradient(x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(253,250,250), stop:0.2 rgb(253,250,250), stop:1 rgb(250,244,229));
color: rgb(93, 109, 109)
}
解决方案
刚刚测试了这个(黑色和粗框只是为了看东西),因此应该可以工作:
QTabWidget::pane {border: 3px solid black; border-radius: 7px;}
推荐阅读
- php - 创建一个 url,它会弹出一个显示来自 sql 的数据的新页面
- mongodb - 如何高效查询数百个分区以获取图数据
- logstash - 升级到 logstash 7.1.1 后更换过滤器无法正常工作
- python - 当一列在熊猫中有两个变量值时,如何融化数据框?
- javascript - 找出一个元素是否是特定元素类型的后代?
- javascript - 确定其三角形javascript代码是否问题/初学者
- angular - 使用 Angular 在 Linux 下编译现有项目?
- shiny - 如何在 Shiny 应用中使用 transition_reveal
- python - 为什么全局关键字即使无法访问也不会被忽略?(Python)
- vb.net - 我可以在 Vb.net 中制作登录表单而不使用提交、登录等按钮吗