FelixB
19th July 2011, 08:55
Hi,
I want to customize the title of a QGroupBox by using a stylesheet. See the desired result in the attached image (qgroupbox_desired.png). A almost have the layout, but the title background is too small (qgroupbox_wrong_title.png). how can I extend the title over the whole width?
my stylesheet:
QGroupBox
{
background-color:transparent;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border: 1px solid #acacac;
border-top: none;
margin-top: 5px;
}
QGroupBox::title
{
subcontrol-origin: margin;
background:url(:/assets/subWindowBackground);
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border: 1px solid #0b477b;
border-bottom: none;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #005192, stop: 1 #002f60);
padding: 2 2px;
color: white;
}
thanks in advance!
Felix
I want to customize the title of a QGroupBox by using a stylesheet. See the desired result in the attached image (qgroupbox_desired.png). A almost have the layout, but the title background is too small (qgroupbox_wrong_title.png). how can I extend the title over the whole width?
my stylesheet:
QGroupBox
{
background-color:transparent;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border: 1px solid #acacac;
border-top: none;
margin-top: 5px;
}
QGroupBox::title
{
subcontrol-origin: margin;
background:url(:/assets/subWindowBackground);
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border: 1px solid #0b477b;
border-bottom: none;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #005192, stop: 1 #002f60);
padding: 2 2px;
color: white;
}
thanks in advance!
Felix