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

原文地址:https://www.cnblogs.com/findumars/p/6272236.html