Results 1 to 5 of 5

Thread: QGroupBox title position

  1. #1
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default QGroupBox title position

    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.)
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QGroupBox title position

    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.

  3. #3
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: QGroupBox title position

    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.
    Attached Images Attached Images

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QGroupBox title position

    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.

  5. #5
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: QGroupBox title position

    @Chris,

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

Similar Threads

  1. customizing QGroupbox title
    By FelixB in forum Newbie
    Replies: 3
    Last Post: 7th February 2014, 15:24
  2. QGroupBox image in title
    By friendofgermany in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2011, 14:12
  3. QGroupBox's title
    By lzpmail in forum Newbie
    Replies: 2
    Last Post: 3rd June 2011, 02:00
  4. QGroupBox title alignment
    By binaural in forum Newbie
    Replies: 2
    Last Post: 9th April 2010, 21:56
  5. How to set color for QGroupBox Title
    By arunvv in forum Qt Programming
    Replies: 5
    Last Post: 4th December 2008, 17:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.