标签栏顶部的 Qt 样式表奇怪的线条 [英] Qt stylesheet weird line on top of tab bar

查看:49
本文介绍了标签栏顶部的 Qt 样式表奇怪的线条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了 QTabWidget 的样式并在标签栏顶部出现了一条奇怪的线.仅当它有多个标签时才会发生.

I style my QTabWidget and got a weird line on top of the tab bar. It only happens when it has multi tabs.

QTabWidget::pane {
    border-top: 1px solid #c4c4c4;
    top: -1px;
}

QTabWidget::tab-bar {
    left: 5px;
}

有什么建议可以解决这个问题吗?谢谢.

Any advice to fix this? Thanks.

推荐答案

需要在QTabBar中关闭base:

You need to turn off the base in the QTabBar:

QTabBar {
    qproperty-drawBase: 0;
}

这篇关于标签栏顶部的 Qt 样式表奇怪的线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆