• 3600阅读
  • 1回复

[提问]怎样为widget内的所有按钮设置统一样式 [复制链接]

上一主题 下一主题
离线zzxap
 

只看楼主 倒序阅读 楼主  发表于: 2011-03-23

ui->tabWidget->setStyleSheet("\
                                 QTabBar::tab {\
                                        color: rgb(84,2,119);\
                                        background-image: url(:/pics/wood.jpg); \
                                        border: 2px solid rgb(68,66,64);\
                                        border-bottom-color: rgb(68,66,64); \
                                        border-top-left-radius: 20px;\
                                        border-top-right-radius: 20px;\
                                        max-height: 21px;\
                                        min-width: 8ex;\
                                        padding: 2px;\
                                        } \
                                  QTabWidget::tab-bar {\
                                        alignment: center;\
                                        } \
                                  QTabBar::tab:!selected {\
                                        margin-top: 5px; \
                                        }\
                                  QTabBar::tab:selected {\
                                        color: rgb(255,0,128); \
                                        }\
                                  ");
有10个button,难道要ui->tabWidget->setStyleSheet 10次?
[ 此帖被zzxap在2011-03-23 09:23重新编辑 ]
离线zzxap

只看该作者 1楼 发表于: 2011-03-23
upp
快速回复
限100 字节
 
上一个 下一个