请帮我写一个暗黑风格的QGroupBox的QSS代码
时间: 2024-05-26 14:10:34 浏览: 147
好的,以下是暗黑风格的QGroupBox的QSS代码:
QGroupBox{
border: 2px solid #555555;
border-radius: 5px;
margin-top: 25px;
font-size: 16px;
font-weight: bold;
color: #CCCCCC;
background-color: #222222;
padding: 10px;
}
QGroupBox::title{
subcontrol-origin: margin;
subcontrol-position: top center;
border: none;
font-size: 20px;
font-weight: bold;
padding: 5px;
color: #CCCCCC;
}
希望这段代码能帮到你!
相关问题
请帮我写一个QGroupBox炫酷黑框效果的qss代码
A:
```css
QGroupBox {
border: 2px solid #333333;
border-radius: 5px;
padding-top: 10px;
font-weight: bold;
color: #ffffff;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
left: 10px;
margin-top: -10px;
padding-left: 10px;
padding-right: 10px;
background-color: #333333;
border: 2px solid #333333;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
color: #ffffff;
}
```
这段代码将使QGroupBox的边框变成粗细为2px,颜色为黑色的实线,同时圆角为5px。标题栏的背景色也为黑色,左侧有10px的边距,文字加粗并且居中,颜色为白色。
QGroupBox qss code
Here is an example of QGroupBox QSS code:
```
QGroupBox {
border: 2px solid gray;
border-radius: 5px;
margin-top: 10px;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 0 10px;
font-weight: bold;
}
QGroupBox::indicator {
width: 20px;
height: 20px;
}
QGroupBox::indicator:checked {
image: url(checked.png);
}
QGroupBox::indicator:unchecked {
image: url(unchecked.png);
}
```
This code sets the border, border radius, and margin for the QGroupBox. It also styles the title by setting the padding and font weight. The QGroupBox indicator is styled with a width and height, and different images are used for when it is checked or unchecked.
阅读全文