生活随笔
收集整理的這篇文章主要介紹了
Qt控件样式QSS
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Qt控件樣式QSS
- QSS樣式如何使用
- 打開 Qt 助手,在索引輸入 style sheet
QSS樣式如何使用
打開 Qt 助手,在索引輸入 style sheet
Qt部分控件QSS樣式
* {outline
: none
;
}QDialog {background
: #D6DBE9
;
}QPushButton {border
: 1px solid #
298DFF
; border
-radius
: 3px
; background
-color
: #F2F2F2
; color
: #
298DFF
; font
-family
: "Microsoft YaHei"; font
-size
: 10pt
;
}QPushButton:hover
{ background
-color
: #
298DFF
;color
: #F2F2F2
;
}QPushButton:checked
{ border
: 1px solid #FF5242
;background
-color
: #F2F2F2
;color
: #FF5242
;
}QPushButton:pressed
{ background
-color
: #
257FE6
;
}QPushButton:checked
:pressed
{ background
-color
: #F2F2F2
;
}QPushButton:disabled
{ border
: 1px solid #CDCDCD
;background
-color
: #CDCDCD
;color
: #B4B4B4
;
}QPushButton#
ImageButton { border
-image
: url(":/Resource/border_image"); background
-color
: transparent
;
}QPushButton#
ImageButton:hover
{border
-image
: url(":/Resource/border_image_hover");
}QPushButton#
ImageButton:pressed
{border
-image
: url(":/Resource/border_image");
}QPushButton:menu
-indicator
{ subcontrol
-origin:padding
; subcontrol
-position
: center right
; image
: url(:/Resource/down_arrow_normal
);
}QPushButton:menu
-indicator
:hover
, QPushButton:menu
-indicator
:open { position
: relative
;top
: 2px
;left
: 2px
;image
: url(:/Resource/down_arrow_hover
);
}QMenu { border
: 1px solid gray
;border
-radius
: 3px
;background
-color
: #F2F2F2
;
}QMenu::item { padding
: 0px
0px
0px
40px
;border
: 0px solid transparent
;background
-color
: transparent
;color
: #
298DFF
;min
-width
: 108px
; min
-height
: 30px
;
}QMenu::item:selected
{ background
-color
: #
298DFF
;color
: #F2F2F2
;
}
"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{"
"height:6px;text-align:center;font-size:14px;color:transparent;border-radius:3px;background: #EEEEEE;"
"}""QProgressBar::chunk{"
"border-radius:3px;"
"background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #0088D3,stop:1 #0050A7);""}"
總結
以上是生活随笔為你收集整理的Qt控件样式QSS的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。