【问题标题】:QTabWidget styling - missing the bottom of my 'g...s'QTabWidget 样式 - 缺少我的 'g...s' 的底部
【发布时间】:2014-05-16 22:03:58
【问题描述】:

我的 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”​​的底部,因为它们似乎被切断了?

【问题讨论】:

    标签: c++ qt stylesheet


    【解决方案1】:

    您应该通过调整这部分中的值来增加更多空间:

    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 是我编译的结果。我没有足够的声望点来发布图片。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 2011-01-29
      相关资源
      最近更新 更多