Results 1 to 4 of 4

Thread: customizing QGroupbox title

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default customizing QGroupbox title

    Hi,

    I want to customize the title of a QGroupBox by using a stylesheet. See the desired result in the attached image (qgroupbox_desired.png). A almost have the layout, but the title background is too small (qgroupbox_wrong_title.png). how can I extend the title over the whole width?

    my stylesheet:
    Qt Code:
    1. {
    2. background-color:transparent;
    3. border-bottom-left-radius: 3px;
    4. border-bottom-right-radius: 3px;
    5. border: 1px solid #acacac;
    6. border-top: none;
    7. margin-top: 5px;
    8. }
    9.  
    10. QGroupBox::title
    11. {
    12. subcontrol-origin: margin;
    13. background:url(:/assets/subWindowBackground);
    14. border-top-left-radius: 3px;
    15. border-top-right-radius: 3px;
    16. border: 1px solid #0b477b;
    17. border-bottom: none;
    18. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    19. stop: 0 #005192, stop: 1 #002f60);
    20. padding: 2 2px;
    21. color: white;
    22. }
    To copy to clipboard, switch view to plain text mode 

    thanks in advance!
    Felix
    Attached Images Attached Images

Similar Threads

  1. QGroupBox's title
    By lzpmail in forum Newbie
    Replies: 2
    Last Post: 3rd June 2011, 02:00
  2. QGroupBox title alignment
    By binaural in forum Newbie
    Replies: 2
    Last Post: 9th April 2010, 21:56
  3. How to set color for QGroupBox Title
    By arunvv in forum Qt Programming
    Replies: 5
    Last Post: 4th December 2008, 17:50
  4. QGroupBox title truncated on both sides
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2006, 15:02
  5. Customizing Mainwindow's title bar
    By Anitha in forum Qt Programming
    Replies: 3
    Last Post: 13th February 2006, 13:13

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
  •  
Qt is a trademark of The Qt Company.