Customise QGroupBox title
-
Hello everyone,
I want to customise my groupbox title which contains 2 parts the first like "SOME TEXT " and the second like ">> SOME OTHER TEXT" must be in red color text, bold and with font size egal to 14.I've searched and tried to use the HTML code or the QGroupBox::title but nor has done a result.
Can anyone tell me is this operation is possibile and if yes how ?
Note that I'm using Qt4.3.
Many thanks in advance.
Best regards. -
The recommended way is to use "Qt Style Sheet":http://doc.qt.digia.com/4.3/stylesheet.html:
QGroupBox* gb = new QGroupBox;
gb->setStyleSheet("QGroupBox { color : red; }"); -
Hello,
Thansk for your reply but I want to modify only the title. But this will modify all items that contains the GroupBox
Have you onther way ?
-
Perhaps that is specific to Qt 4.3. Probably a bug.
Here is that code in action:
!http://s28.postimg.org/c8k75ofn1/imagine2.png()!It's done using Qt 5.1.1, but the others should do the same. This is an old functionality.
-
Thanks a lot for your response.
As you said, may be it is an error in the 4.3 Version. We have taken an other way to show data.