Results 1 to 3 of 3

Thread: QGroupBox title alignment

  1. #1
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QGroupBox title alignment

    Hi,

    I'm using QT 4.5.3 on linux. When I drop QGroupBox to form groupd box title is centered and not left aligned.
    I try to align it to left but it doesn't help and it was still in the center. How can I align it to left?

    Thanks,

    Marek

  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGroupBox title alignment

    Difficult to say without a piece of code. Do your mind showing us the relevant part?
    Qt provides a function to set the alignment of a QGroupBox title, have look at http://qt.nokia.com/doc/4.6/qgroupbo...alignment-prop
    It's good to know that you can do it as well through style sheet, http://doc.trolltech.com/4.3/stylesh...zing-qgroupbox
    Last edited by toutarrive; 8th April 2010 at 11:24. Reason: Adding link

  3. #3
    Join Date
    Feb 2010
    Location
    Pennsylvania, USA
    Posts
    36
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QGroupBox title alignment

    It sounds like binaural is using Designer.

    You should be able to modify the alignment of the group box title by changing the "Alignment" in the properties box. If you dive into the code, you can also use toutarrive's suggestions.

    It is probably center-aligning because it is inheriting whatever linux theme is currently in use. You may need to over-ride inheriting the theme in order to left-align the title.

Similar Threads

  1. Window Title Text left alignment issue.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 14:46
  2. How to set color for QGroupBox Title
    By arunvv in forum Qt Programming
    Replies: 5
    Last Post: 4th December 2008, 17:50
  3. QGroupBox
    By merry in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2007, 13:11
  4. Title Bar Alignment and mainwindow options
    By Krish_ng in forum Qt Programming
    Replies: 6
    Last Post: 16th July 2007, 08:10
  5. QGroupBox title truncated on both sides
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2006, 15:02

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.