Qt控件样式QSS

QSS样式如何使用

打开 Qt 助手,在索引输入 style sheet

在这里插入图片描述

Qt部分控件QSS样式

"QWidget{boeder: 1px solid #000; background: rgba(255,255,255,130);border-radius: 5px;}"
"                                                                           \
QListWidget { outline: none; border:1px solid #00000000; color: black; }    \
QListWidget::Item { width: 50px; height: 50px; }                            \
QListWidget::Item:hover { background: #4395ff; color: white; }              \
QListWidget::item:selected { background: #4395ff; color: black; }           \
QListWidget::item:selected:!active { background: #00000000; color: black; } \
"
"QFrame{background: #FFFFFF; border-image:none; border-radius: 8px;}"

"QFrame{background-color: rgba(255,255, 255, 204); border-image:none; border-radius: 8px; color: #0050A7; }"
"QLabel{border-image:none; background: transparent; border:none; color:#333333; font-family: \"等线\"; font-size: 24px;}"

"QLabel{border-image:none; background: transparent; border:none; color:#333333; font-family: \"等线\"; font-size: 30px;}"

"QLabel{border-image:none;border:none; background:#FFFFFF; font-family: \"等线\"; font-size: 28px;border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;}"                        
"   \
QToolButton{border-image: none; color: #004EA1; border: 1px solid #E5E5E5;   \
border-right:none; border-bottom:none; border-left:none; color:#0050A7; font-family: \"等线\"; \
font-size: 24px;border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;}  \
"

"QToolButton:hover{border-image: none;color : rgba(0, 78, 161, 100);}"

"QToolButton{border-image: url(:/res/image/close.png); background: transparent;border:none;}"

"QToolButton:hover{border-image: url(:/res/image/close.png);background : rgba(185, 236, 249, 100);border:none;}"

"QToolButton{border-image: none; color: #004EA1; border: 1px solid #E5E5E5; "
"border-bottom:none; border-left:none;color: #666666; font-family: \"等线\"; font-size: 24px;"
"border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;}"

"QToolButton:hover{border-image: none;color : rgba(0, 78, 161, 100);}"

"QToolButton{ width: 100px; height:40px;border-image: none;color: #666666; font-family: \"等线\"; font-size: 24px; border-radius: 4px;background: #FFFFFF;}"

"QToolButton{border-image: none; color: #666666; border: 1px solid #E5E5E5; background: rgba(255,255,255,255);font-family: \"等线\"; font-size: 22px;"
"border-bottom:none; border-left:none;"
"border-bottom-left-radius: 8px; border-bottom-right-radius: 0px;border-top-left-radius: 0px; border-top-right-radius: 0px;}"

"QToolButton:!enabled{border-image: none; color: rgba(102, 102, 102, 102); border: 1px solid #E5E5E5; background: rgba(255,255,255,255);font-family: \"等线\"; font-size: 22px;"
"border-bottom:none; border-left:none;"
"border-bottom-left-radius: 8px; border-bottom-right-radius: 0px;border-top-left-radius: 0px; border-top-right-radius: 0px;}"

"QToolButton{border-image: none; color: #666666; border: 1px solid #E5E5E5; background: rgba(255,255,255,255);font-family: \"等线\"; font-size: 22px;"
"border-bottom:none; border-left:none;"
"border-bottom-left-radius: 0px; border-bottom-right-radius: 8px;border-top-left-radius: 0px; border-top-right-radius: 0px;}"

"QToolButton:!enabled{border-image: none; color: rgba(102, 102, 102, 102); border: 1px solid #E5E5E5; background: rgba(255,255,255,255);font-family: \"等线\"; font-size: 22px;"
"border-bottom:none; border-left:none;"
"border-bottom-left-radius: 0px; border-bottom-right-radius: 8px;border-top-left-radius: 0px; border-top-right-radius: 0px;}"
"QComboBox{border: 1px solid gray;border-radius:6px; padding: 1px 40px 1px 1px; color: #333333; background: transparent;font-family: \"等线\"; font-size: 20px;}"

"QComboBox::drop-down{margin-right: 10px; background-color: transparent; }"

"QComboBox::down-arrow {width:25px; height:25px; border: 1px solid gray;border-radius:6px; background: transparent; border-image: url(:/res/image/down.png);}"

"QComboBox::down-arrow:on{width:25px; height:25px; border-image: url(:/res/image/up.png);}"

"QComboBox QAbstractItemView{border-image: none;color: #333333;background-color: rgb(255, 255, 255);border-radius:0px;outline:none; font-family: \"等线\"; font-size: 20px;}"

"QComboBox QAbstractItemView::item{color: #333333;border: 1px solid gray;border-radius:6px;font-family: \"等线\"; font-size: 20px;}"

"QComboBox QAbstractItemView::item:hover{color: green;border: 1px solid green;border-radius:6px;font-family: \"等线\"; font-size: 20px;}"
"QProgressBar{border-image:none;border:none;}"
"QProgressBar{"
//                "border:2px solid grey;border-radius:11px;text-align:center;"
//                "height:30;"
                "background: red;"
//                "text-align: center;"
//                "color:rgb(0,0,0);"
"height:6px;text-align:center;font-size:14px;color:transparent;border-radius:3px;background: #EEEEEE;"
"}"

"QProgressBar::chunk{"
//                "border-top-left-radius:5px;"
//                "border:1px solid black;"
//                "background-color:#CD96CD;"
//                "width:20px;"
"border-radius:3px;"
"background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #0088D3,stop:1  #0050A7);"

"}"

猜你喜欢

转载自blog.csdn.net/wct3344142/article/details/121398799