PDA

View Full Version : QGroupBox title position



stevel
17th April 2013, 19:54
I'm trying to create a QGoupBox with a title in a certain position. I've attached a screenshot of what I am trying to accomplish, and another of what it looks like at the moment. I think all I need to do is to move the top of the border down just a few pixels, but I am not sure how to do this. I expect that there may be a style sheet syntax that I need to use. If someone could enlighten me, I would appreciate it.
(QGroupBox2 is what I want it to look like, QGroupBox1 is what I am getting at the moment.)

ChrisW67
18th April 2013, 00:47
On what platform and with what style? The Windows, WindowsVista, and Cleanlooks styles al produce a checkable group box that looks like that by default.

stevel
18th April 2013, 19:40
Chris,

Thanks for your reply. I am running on windows 8, I believe with the default style, and I found that I had to specify that the border be visible. The default seemed to be a QGroupBox with an invisible border.

Here's my current style sheet, and I've attached a picture of the results I am seeing at the moment.

setStyleSheet("QGroupBox { background-color: transparent; border: 1px solid gray; border-radius: 5px; }");

Thanks for your help.

ChrisW67
19th April 2013, 01:22
I've noticed a lot of Windows 8-isms with my application-in-build and Qt 4.8.4. The handles on splitters, for example, are completely absent visually (but functional). You may find some of these go away in later Qt5 point releases.

Have a look at Customizing QGroupBox. You can target the ::title sub-control and fiddle with its subcontrol-origin and related properties.

stevel
19th April 2013, 18:33
@Chris,

I'm using 5.0.2. If you are right, should I be trying to report this as a bug?