Results 1 to 8 of 8

Thread: how to change QGroupBox frame color? (Qt4)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: how to change QGroupBox frame color? (Qt4)

    I just found out that this code works where the other code snippets you suggested didn't work for me:
    Qt Code:
    1. //grpControls is a QGroupBox which is parented to another widget
    2. palette.setColor(grpControls->backgroundRole(), QColor(0,255,255));
    To copy to clipboard, switch view to plain text mode 
    In all the code you supplied the group box was not parented, or its parent was not visible in the code supplied... I think it plays a role in this behaviour.
    Another thing that bothers me is when I try to set the frame color with designer no color role changes the frame color...
    Can you confirm this?

    Thanks for your help!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: how to change QGroupBox frame color? (Qt4)

    @jpn
    Yes, your last reply was the right answer!
    Its the Plastique, and when I try this with another stlyle its behaves as expected.
    Tanks!

Similar Threads

  1. Change the shape of a frame.
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2007, 06:40
  2. Change frame rate
    By superutsav in forum General Programming
    Replies: 1
    Last Post: 3rd August 2006, 21: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
  •  
Qt is a trademark of The Qt Company.