我的 QtabWidget 目前有以下样式表
QTAB
QTabWidget
{
/* min-width:5000em;*/
}
QTabWidget::tab-bar
{
left: 5px; /* move to the right by 5px */
}
QTabWidget::pane
{
border-top: 1px solid gray;
border-left: 1px solid gray;
border-right: 1px solid gray;
border-bottom: 1px solid gray;
}
QTabBar::tab
{
background-color: rgb(166, 166, 166);
min-width: 70px;
padding-top : 6px;
padding-bottom : 8px;
color: rgb(255, 255, 255);
font: 10pt "Arial";
}
QTabBar::tab:selected, QTabBar::tab:hover
{
background-color: rgb(127, 127, 127);
}
QTabBar::tab:selected
{
/*border-color: #9B9B9B;*/
}
QTabBar::tab:!selected
{
margin-top: 2px; /* make non-selected tabs look smaller */
}
结果是这样的
我想知道如何修复我的 'g' 的底部,因为它们似乎被切断了?
最佳答案
您应该通过调整此部分中的值来增加更多空间:
QTabBar::tab
{
background-color: rgb(166, 166, 166);
min-width: 70px;
padding-top : 6px;
padding-bottom : 8px;
color: rgb(255, 255, 255);
font: 10pt "Arial";
}
例如,添加一个最小高度以容纳足够的文本空间,这里的填充也存在问题,只需删除行 padding-top: 6px
和 padding-bottom: 8px
:
QTabBar::tab
{
background-color: rgb(166, 166, 166);
min-width: 70px;
color: rgb(255, 255, 255);
font: 10pt "Arial";
}
here是我编译的结果。我没有足够的声誉点数来发布图像。
关于c++ - QTabWidget 样式 - 缺少我的 'g...s' 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23705238/