Qt-QGroupBox样式设置

1.整个控件相关设置

QGroupBox {

border:1px solid rgb(53, 153, 252);

margin-top: 2.5ex;

}

2.控件标题部分,subcontrol-position:标题位置

left:标题距离左边线的距离

QGroupBox::title {

color: rgb(0, 0, 0);

subcontrol-origin: margin;

subcontrol-position: top left;

left:10px;

top:0px;

padding: 0px;

}

3.标题前方指示符相关设置(个人认为就是前面复选框)

QGroupBox::indicator {

width: 15px;

height: 15px;

}

QGroupBox::indicator:unchecked {

image: url(:/image/checkbox_unchecked.png);

}

QGroupBox::indicator:unchecked:hover {

image: url(:/image/checkbox_unchecked_hover.png);

}

QGroupBox::indicator:checked {

image: url(:/image/checkbox_checked.png);

}

QGroupBox::indicator:checked:hover {

image: url(:/image/checkbox_checked_hover.png);

}

你可能感兴趣的:(Qt)