How to modify font for title of QGroupBox?
-
Hello,
I have defined a QGroupBoxprogress_box = QGroupBox("PROGRESS") progress_box.setFont(QFont('Verdana', 16)) progress_box.format("color:brown; font-weight:600;")
This changes the font format for everything in the group but the target is to modify only the title. When I tried changing the second line to:
progress_box.title.setFont(QFont('Verdana', 16))
got an error message. I listed the methods associated to QGroupBox.title but didn't find what I was looking for.
Is there any easy way to modify the title of a QGroupBox without touching anything else?
Thanks. -
Hi,
AFAIK, QGroupBox does not have a format method. Are you thinking about style sheets ?
-
@SGaist
Just for clarification, the 'format' method was listed when I tried dir(progress_box.title) so it'd be associated with title not with QGroupBox per se. Anyway, I could use a stylesheet but my question would how to apply it only to the title and not to everything else in the QGroupBox. -
The
title
property contains a string. It has nothing to do with the visual aspect of the QGroupBox.The link in my previous post shows how to modify a QGroupBox object with a dedicated stylesheet.
-