Qt常見皮膚qss代碼(有Metro的風格)


##QTabWidget

  • 淡藍色效果TabWidget(屬性值lightblue)
QTabWidget[lightblue = "true"] QTabBar::tab{ border-top:1px solid rgb(249,249,249); border-top-left-radius: 4px; border-top-right-radius: 4px; max-height:20px; min-height:20px; min-width:95px; font-family:microsoft yahei; color:rgb(50,50,50); font-size:13px; padding:0px 0px 0px 0px; border-image:url(); margin: 0px; padding-bottom:15px; } QTabWidget[lightblue = "true"] QTabBar::tab:selected{ border-left:1px solid rgb(192,215,250); border-right:1px solid rgb(192,215,250); border-top:1px solid rgb(192,215,250); color:rgb(50,50,50); background-color:rgb(249,249,249); font-size:13px; border-image:url(); margin: 0px; } QTabWidget[lightblue = "true"]::pane { border-top: 1px solid rgb(192,215,250); position: absolute; top: -1px; } 

效果如下圖所示: QTableWidget

##QLabel

  • 藍色標題Label(屬性值blueTitle)
QLabel[blueTitle="true"] { font-size:18px; font-family:Microsoft YaHei; color:rgb(255,255,255); background-color:rgb(5 ,112, 183 ); padding-left:25px; } 

效果圖如下所示:

  • blueTitleLabel
  • 淡灰色標題Label(屬性值lightgrayTitle)
QLabel[lightgrayTitle="true"] { font-family:Microsoft YaHei; font-size:16px; background-color: rgb(207, 207, 207); padding-left: 25px; } 

效果圖如下所示:

  • lightGrayTitleLabel

##QPushbutton

  • 藍色按鈕(屬性值blueButton)
QPushButton[blueButton="true"] { color:rgb(255,255,255); border-radius:3px; background-color:rgb(0,109,204); font-family:Arial; } QPushButton[blueButton="true"]:hover { background-color:rgb(0 ,119, 224 ); } QPushButton[blueButton="true"]:pressed { background-color:rgb(0 ,149 ,255 ); } 

效果圖如下所示:

  • blueButton
  • 藍框按鈕(屬性值)
QPushButton[blueBorderButton = "true"] { border:1px solid; border-color:#afafaf; font-family:microsoft yahei; color:#555555 } QPushButton[blueBorderButton = "true"]:hover { border:1px solid; border-color:#11a9d6; font-family:microsoft yahei; color:#555555 } QPushButton[blueBorderButton = "true"]:pressed { background-color:#11a9d6; border:1px solid; border-color:#afafaf; font-family:microsoft yahei; color:white } 

效果圖如下所示:

  • blueButton blueBorderButton_normal blueBorderButton_push

QProgressBar

  • 淡紅色進度條
QProgressBar[redProgressBar = "true"]{ color : solid gray; border: 2px solid gray; border-radius: 5px; background: transparent; padding: 0px; text-align : center ; } QProgressBar[redProgressBar = "true"]::chunk{ background: #B22222; } 
  • redProgressBar

 

http://daodaoliang.com/blog/2014/10/30/Qt%E5%B8%B8%E8%A7%81%E7%9A%AE%E8%82%A4%E7%9A%84QSS.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM