加载中…
个人资料
湖北荆楚闲人
湖北荆楚闲人
  • 博客等级:
  • 博客积分:0
  • 博客访问:1,882
  • 关注人气:5
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Qt中如何改变QProgressBar中进度条的颜色

(2018-06-15 16:32:22)
https://zhidao.baidu.com/question/111017652.html



Qt中改变QProgressBar中进度条的颜色方法如下:

  QProgressBar {   border: 2px solid grey;   border-radius: 5px;   background-color: #FFFFFF;}QProgressBar::chunk {   background-color: #05B8CC;   width: 20px;}QProgressBar {   border: 2px solid grey;   border-radius: 5px;   text-align: center;}


不想显示进度条上的文字可以把文字设置透明

 


color: transparent



所有的代码如下:


QProgressBar 

{   

        border: 2px solid grey;   

   border-radius: 5px;   

       background-color: #FF0000;

     text-align:center;

     

}

QProgressBar::chunk 

{   

    background-color: #05B8CC;   

        width: 20px;

}



QProgressBar::chunk 

{   

       background-color: #05B8CC;   

        width: 20px;

}

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有