c++ - QTabWidget 样式 - 缺少我的 'g...s' 的底部

标签 c++ qt stylesheet

我的 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 */

 }

结果是这样的

enter image description here

我想知道如何修复我的 '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: 6pxpadding-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/

相关文章:

c++ - 使用CStringW/CStringA和CT2W/CT2A转换字符串有什么区别?

c++ - 如何在我的 Opensuse 中安装 qt 演示/示例?

c++ - 如何安全删除 QT::QTcpSocket?

c++ - 类私有(private)成员 - 数组访问失败

c++ - 我如何让 QtCreator 为调试/发布制作一个单独的 Makefile?

python - 从 resources.qrc 文件创建 QIcon

css - Firefox 不会加载 CSS

c++ - 如何通过 Qt 样式表自定义 Qt 应用程序的标题栏?

php - 如何保留嵌入式小部件的样式?

python - 将最左边的设置位转换为右侧交替位的位操作?