Results 1 to 6 of 6

Thread: could not change QProgressBar color

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: could not change QProgressBar color

    Hey,
    instead of QColor(Qt::green) do something like Qt::blue
    Qt Code:
    1. QPalette pal = progress->palette();
    2. pal.setColor(progress->backgroundRole(), Qt::blue);
    3. progress->setPalette(pal);
    To copy to clipboard, switch view to plain text mode 

    you can also try setting a new style sheet
    like
    Qt Code:
    1. progress->setStyleSheet("*{ background-color: rgb(45, 50, 30); }");
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to toufic.dbouk for this useful post:

    dpn (15th September 2013)

Similar Threads

  1. Change in color map?
    By bigjoeystud in forum Qwt
    Replies: 4
    Last Post: 8th September 2010, 20:00
  2. Replies: 3
    Last Post: 22nd January 2010, 16:46
  3. how to change the color of the frame
    By wagmare in forum Qt Programming
    Replies: 5
    Last Post: 12th May 2009, 12:46
  4. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25
  5. Change HLine color
    By smtgra011 in forum Newbie
    Replies: 3
    Last Post: 5th July 2007, 06:55

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.