Qt Qss黑色样式(带详细注释)【一】

/*浮动窗口*/
QDockWidget{
	color:rgb(230,230,230);
	/*背景色*/
	background-color:#343434;
}
/*浮动窗口-子控件弹出-鼠标停靠*/
QDockWidget::float-button:hover{
	/*背景色*/
	background-color:#0099ff;
}
/*按钮*/
QPushButton{
	/*前景色*/
	color:#e6e6e6;
	/*背景色*/
	background-color:rgb(0,153,255);
	/*边框-圆角*/
	border-radius:3px;
	/*字体*/
	font-family: "Microsoft YaHei";
	/*字体加粗*/
	font-weight:bold;
	/*字体尺寸*/
	font-size: 12px;
	/*高度*/
	height: 20px;    
}
/*按钮-鼠标停靠*/
QPushButton:hover{
	/*背景色*/
	background-color:rgb(0,120,215);
}
/*按钮-鼠标按下*/
QPushButton:pressed{
	/*设置定位元素左外边距边界与其包含块左边界之间的偏移。*/
	top: 1px;
	/*设置定位元素的上外边距边界与其包含块上边界之间的偏移。*/
	left: 1px;
}
/*单行文本编辑*/
QLineEdit{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*左内边距*/
	padding-left: 4px;
	/*最小宽度 - 1em 等于当前的字体尺寸。*/
	min-width: 6em;
}
/*单行文本编辑 - 鼠标停靠*/
QLineEdit:hover{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(0,122,204);
	/*左内边距*/
	padding-left: 4px;
	/*最小宽度*/
	min-width: 6em;
}
/*文本编辑*/
QTextEdit{
	/*前景色*/
	color:rgb(0,0,0);
}
/*单选按钮*/
QRadioButton{
	/*前景色*/
	color:rgb(230,230,230);
	/*边框*/
	border:none;
	/*字体*/
	font-family: "Microsoft YaHei";
	/*字体加粗*/
	font-weight:bold;
	/*字体尺寸*/
	font-size: 12px;
}
/*带文本的复选框*/
QCheckBox{
	/*前景色*/
	color:rgb(230,230,230);
	/*边框*/
	border:none;
	/*字体*/
	font-family: "Microsoft YaHei";
	/*字体加粗*/
	font-weight:bold;
	/*字体尺寸*/
	font-size: 12px;
}
/*标签*/
QLabel{
	/*前景色*/
	color:rgb(230,230,230);
	/*边框*/
	border:none;
	/*字体*/
	font-family: "Microsoft YaHei";
	/*字体加粗*/
	font-weight:bold;
	/*字体尺寸*/
	font-size: 12px;
}

QTabWidget {
	border: 0px transparent rgb(0,122,204);
}

QTabWidget::pane {
	border-bottom: 0px transparent rgb(0,122,204);  
	padding: 5px;    	
	margin: 0px;
}

QTabBar {  
	border-top: 2px solid rgb(0,122,204);    
	qproperty-drawBase: 0;	
}

QTabBar:focus {
	border: 0px transparent black;
	outline: 0px;
}

QTabBar::tab:top {
	color: rgb(230,230,230);    
	border: 0px transparent rgb(0,122,204);    
	border-bottom: 1px transparent black;    
	background-color: rgb(45,45,48);    
	padding: 5px;    min-width: 50px;        
}
QTabBar::tab:top:selected {
	color: rgb(230,230,230);    
	background-color: rgb(0,122,204);    
	border: 0px transparent rgb(0,122,204);    
	border-bottom: 2px solid rgb(28,151,234);        
}
QTabBar::tab:top:!selected:hover {
	background-color: rgb(28,151,234);
}
/* BOTTOM TABS */QTabBar::tab:bottom {
	color: rgb(230,230,230);   
	border-top: 2px solid rgb(0,122,204);      
	background-color: rgb(45,45,48);   
	padding: 5px;            
	min-width: 50px;  
}
QTabBar::tab:bottom:selected {    
	background-color: rgb(0,122,204);          
}
QTabBar::tab:bottom:!selected:hover {
	background-color: rgb(28,151,234);
	border-top: 2px solid rgb(0,122,204);
}
/* LEFT TABS */QTabBar::tab:left {
	color: rgb(230,230,230);    
	border: 0px transparent rgb(0,122,204);    
	border-left: 1px transparent black;    
	background-color: rgb(45,45,48);    
	padding: 5px;            
	min-height: 50px;
}
QTabBar::tab:left:selected {
	color: rgb(230,230,230);    
	background-color: rgb(0,122,204);    
	border: 0px transparent rgb(0,122,204);    
	border-left: 2px solid rgb(28,151,234);        
}
QTabBar::tab:left:!selected:hover {
	background-color: rgb(28,151,234);
}
/* RIGHT TABS */QTabBar::tab:right {
	color: rgb(230,230,230);    
	border: 0px transparent rgb(0,122,204);    
	border-right: 1px transparent black;    
	background-color: rgb(45,45,48);    
	padding: 5px;            
	min-height: 50px;
}
QTabBar::tab:right:selected {
	color: rgb(230,230,230);    
	background-color: rgb(0,122,204);    
	border: 0px transparent rgb(0,122,204);    
	border-right: 2px solid rgb(28,151,234);        
}
QTabBar::tab:right:!selected:hover {
	background-color: rgb(28,151,234);
}

QTabBar QToolButton::right-arrow:enabled {
	image: url(:/qss_icons/rc/right_arrow.png);
}
QTabBar QToolButton::left-arrow:enabled {
	image: url(:/qss_icons/rc/left_arrow.png);
}
QTabBar QToolButton::right-arrow:disabled {
	image: url(:/qss_icons/rc/right_arrow_disabled.png);
}
QTabBar QToolButton::left-arrow:disabled {
	image: url(:/qss_icons/rc/left_arrow_disabled.png);
}
/*菜单栏*/
QMenuBar {
	/*前景色*/
	color: rgb(230,230,230);
	/*背景色*/
	background-color: rgb(49,54,59);    
}
/*菜单栏-子项目*/
QMenuBar::item {
	/*背景透明*/
	background: transparent;
}
/*菜单栏-子项目-选中*/
QMenuBar::item:selected {
	/*背景透明*/
	background: transparent; 
	/*边框*/
	border: 1px solid rgb(118,121,124);
}
/*菜单栏-子项目-按下*/
QMenuBar::item:pressed {
/*菜单*/
	/*前景色*/
	color: #eff0f1;
	/*背景色*/
	background-color: #3daee9;
	/*边框*/
	border: 1px solid #76797C;
	/*外边距-底部*/
	margin-bottom: -1px;
	/*内边距-底部*/
	padding-bottom: 1px;
}
QMenu {
	/*前景色*/
	color: #eff0f1;
	/*背景色*/
	background-color: #3daee9;
	/*边框*/
	border: 0px solid #76797C;
	/*外边距*/
	margin: 1px;
}
/*菜单-图标*/
QMenu::icon {
	/*边距*/
	margin: 5px;
}
/*菜单-子项目*/
QMenu::item {
	/*背景色*/
	background-color:rgb(44,44,44);
	/*边框*/
	border: 1px solid transparent; 
	/*内边距*/
	padding: 5px 30px 5px 30px;
}
/*菜单-子项目-选中*/
QMenu::item:selected {
	/*前景色*/
	color: #eff0f1;
}
/*菜单-分割线*/
QMenu::separator {
	/*背景*/
	background: lightblue;
	/*高度*/
	height: 1px; 
	/*内边距-左*/
	margin-left: 10px;
	/*内边距-右*/	
	margin-right: 5px;
}
/*菜单-指示器*/
QMenu::indicator {
	/*宽度*/
	width: 18px;    
	/*高度*/
	height: 18px;
}
/*数据表格*/
QTableWidget{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(35,35,35);
	/*网格线的颜色*/
	gridline-color:rgb(50,50,50);
	/*边框*/
	border:1px solid rgb(50,50,50);
}
/*数据表格-子项目-选中*/
QTableWidget::item::selected{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(0,112,204);
}
/*数据表格-子项目-焦点*/
QTableWidget::item::focus{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(255,112,204);
}
/*数据表格-表头*/
QTableWidget QHeaderView::section{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(30,30,30);
	/*边框*/
	border:1px solid rgb(50,50,50);
	/*边框-左*/
	border-left:0px;	
	/*边框-底部*/
	border-bottom:1px solid rgb(50,50,50);
	/*高度*/
	height:30;
}
/*数据表格-子项目-鼠标停留*/
QTableWidget::item:hover{
}
/*表右侧的滑条*/
QScrollBar:vertical{
}
/*滑块*/
QScrollBar::handle:vertical{
}
/*滑块悬浮*/
QScrollBar::handle:hover:vertical{
}
/*滑块按下*/
QScrollBar::handle:pressed:vertical{
}
/*滑块已经划过的区域*/
QScrollBar::sub-page:vertical{
}
/*滑块还没有划过的区域*/
QScrollBar::add-page:vertical{
}
/*微调框*/
QSpinBox,QDoubleSpinBox{
	/*前景色*/
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*内边距-左*/
	padding-left: 4px;
	/*最小宽度*/
	/*min-width: 6em;*/
}
/*微调框*/
QSpinBox:hover,QDoubleSpinBox:hover{
	/*边框*/
	border: 1px solid rgb(0,122,204);
}
/*微调框-向上、向下按钮*/
QSpinBox::up-button,
QSpinBox::down-button,
QDoubleSpinBox::up-button,
QDoubleSpinBox::down-button{
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
}
/*微调框-向上、向下按钮-按下*/
QSpinBox::up-button:pressed,
QSpinBox::down-button:pressed,
QDoubleSpinBox::up-button:pressed,
QDoubleSpinBox::down-button:pressed{
	/*背景色*/
	background-color:rgb(0,122,204);
	/*边框*/
	border: 1px solid rgb(0,122,204);
}
/*微调框-向上箭头*/
QSpinBox::up-arrow,
QDoubleSpinBox::up-arrow{
	/*宽度*/
	width: 7px;
	/*高度*/
	height: 3px;
	/*背景图片*/
	background-image: url(:/TradeClient/Resources/up_Arrow.png);
}
/*微调框-向下箭头*/
QSpinBox::down-arrow,
QDoubleSpinBox::down-arrow{
	/*宽度*/
	width: 7px;
	/*高度*/
	height: 3px;
	/*背景图片*/
	background-image: url(:/TradeClient/Resources/down_Arrow.png);
}
/*群组框*/
QGroupBox{
	/*最小高度*/
	min-height:35px;
	/*前景色*/
	color:rgb(230,230,230);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*外边距-顶部*/
	margin-top: 6px;
	/*字体*/
	font-family: "Microsoft YaHei";
	/*字体加粗*/
	font-weight:bold;
	/*字体尺寸*/
	font-size: 12px;
}
/*群组框-标题*/
QGroupBox::title{
	subcontrol-origin: margin;
	subcontrol-position: top left;
  	left:10px;     
  	margin-left: 0px;
  	padding:0 1px;   
}
/*下拉框*/
QComboBox{
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*内边距-左*/
	padding-left: 4px;
}
/*下拉框 - 鼠标停留*/
QComboBox:hover{
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(0,122,204);
	/*内边距-左*/
	padding-left: 4px;
}
/*下拉框 - 下拉按钮*/
QComboBox::drop-down {
	/*边框*/
	border: 0px solid rgb(67,67,70);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*内边距 - 左*/
	padding-left: 4px;
	subcontrol-origin: padding;
	subcontrol-position: top right;
	/*宽度*/
	width: 15px;
}
/*下拉框 - 下拉按钮 - 展开的状态*/
QComboBox::drop-down:on
{
	/*边框*/
	border: 0px solid rgb(67,67,70);
	/*背景色*/
	background-color:rgb(51,51,255);
	/*内边距- 左*/
	padding-left: 4px;
	subcontrol-origin: padding;
	subcontrol-position: top right;
	/*宽度*/
	width: 15px;
}
/*下拉框-下拉箭头*/
QComboBox::down-arrow {
	/*宽度*/
	width: 11px;
	/*高度*/
	height: 5px;
	left: -2px;
	/*背景图片*/
	background-image:url(:/TradeClient/Resources/combobox_arrow.png);
}
/*下拉框-下拉箭头-展开状态*/
QComboBox::down-arrow:on { 
	top: 1px;
	left: -1px;
}
/*下拉框-下拉列表*/
QComboBox QAbstractItemView {
	/*前景色*/
	color:rgb(230,230,230);
	/*背景颜色*/
	background-color:rgb(27,27,28);
	/*选中时背景颜色*/
	selection-background-color: rgb(63,63,70);
	/*边框*/
	border: 0px solid darkgray;
	outline: 0px;
}
/*下拉框-下拉列表-子项目*/
QComboBox QAbstractItemView::item {
	border: 0px;  
	min-height: 25px;
}
/*下拉框-下拉列表-子项目 - 选中*/
QComboBox QAbstractItemView::item::selected {
	background-color: rgb(63,63,70);
	min-height: 30px;
}
/*日期编辑框*/
QDateEdit{
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*内边距-左*/
	padding-left: 4px;
}
/*日期编辑框*/
QDateEdit:hover,QDateTimeEdit:hover{
	/*边框*/
	border: 1px solid rgb(0,122,204);
}
/*日期编辑框-下拉箭头*/
QDateEdit::down-arrow
{
	/*宽度*/
	width: 11px;
	/*高度*/
	height: 5px;
	left: -2px;
	/*背景图片*/
	background-image:url(:/TradeClient/Resources/combobox_arrow.png);
}
/*日期编辑框-下拉箭头- 展开状态*/
QDateEdit::down-arrow:on 
{ 
	top: 1px;
	left: -1px;
}
/*日期编辑框-右侧按钮*/
QDateEdit::drop-down 
{
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51, 51, 55);
	/*边框*/
	border:0px solid rgb(0,122,204);
	/*内边距-左*/
	padding-left:4px;
	subcontrol-origin: padding;
	subcontrol-position: top right;
	/*宽度*/
	width:15px;
}
/*日期时间编辑框*/
QDateTimeEdit
{
	color:rgb(230,230,230);
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
	/*内边距-左*/
	padding-left: 4px;
}
/*日期时间编辑框 - 向上、向下按钮*/
QDateTimeEdit::up-button,
QDateTimeEdit::down-button
{
	/*背景色*/
	background-color:rgb(51,51,55);
	/*边框*/
	border: 1px solid rgb(67,67,70);
}
/*日期时间编辑框 - 向上、向下按钮-按下*/
QtDateTimeEdit::up-button:pressed,
QtDateTimeEdit::down-button:pressed
{
	/*背景色*/
	background-color:rgb(0,122,204);
	/*边框*/
	border: 1px solid rgb(0,122,204);
}
/*日期时间编辑框 - 向上箭头*/
QtDateTimeEdit::up-arrow
{
	/*宽度*/
	width: 7px;
	/*高度*/
	height: 3px;
	/*背景图片*/
	background-image: url(:/TradeClient/Resources/up_Arrow.png);
}
/*日期时间编辑框 - 向下箭头*/
QtDateTimeEdit::down-arrow
{
	/*宽度*/
	width: 7px;
	/*高度*/
	height: 3px;
	/*背景图片*/
	background-image: url(:/TradeClient/Resources/down_Arrow.png);
}
  • 1
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Qt中,可以使用QSSQt Style Sheet)来设置控件的样式QSS是一种样式文本规范,可以通过QApplication::setStyleSheet()方法设置整个应用的样式,或者使用QWidget::setStyleSheet()方法设置某个QWidget及其子类窗体的样式QSS的格式类似于CSS,可以设置控件的背景图片、大小、字体颜色、字体类型、按钮状态变化等属性,用于美化UI界面。通过QSS,可以实现界面和程序的分离,快速切换皮肤,以及快速实现应用程序的外观界面。QSS的优点是简单便捷,可以在不编译运行程序的前提下直观预览一些常用样式的设置效果,方便、直观、快捷地完成对界面的样式风格设置。你可以参考Qt的帮助文档来了解更多关于QSS的用法和示例。\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [Qtqss常用样式总结](https://blog.csdn.net/wangshuping18/article/details/128932269)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [使用Qss设置窗体样式](https://blog.csdn.net/fuhanghang/article/details/124508405)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值