Results 1 to 2 of 2

Thread: Changing Progress Bar Colors

  1. #1
    Join Date
    Aug 2006
    Posts
    90
    Thanks
    6
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Changing Progress Bar Colors

    I am trying to change the colors of my progress bar. For example, if there is an error while I am progressing, I want the bar to turn a color... like red.

    Here is my example:
    Qt Code:
    1. QPalette qpFailure;
    2. qpFailure.setColor(QPalette::Base, Qt::red);
    3. ui.progbarStatus->setPalette(qpFailure);
    To copy to clipboard, switch view to plain text mode 

    I think I am doing it correctly, but I don't know if my gnome window theme is effecting things. I don't know if someone has had a similar issue.

    Thanks,
    Brandon

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing Progress Bar Colors

    Try QPalette::Highlight instead of QPalette::Base.

Similar Threads

  1. Fonts, Colors, and QStyle
    By Jimmy2775 in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2006, 07:26
  2. Progress Bar to be shown!!!
    By Kapil in forum Qt Programming
    Replies: 7
    Last Post: 23rd May 2006, 09:36
  3. Changing the text color of a QTreeView leaf.
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2006, 23:58
  4. Qt Designer 4.0.1 Preview Colors
    By jtyler in forum Qt Tools
    Replies: 2
    Last Post: 14th February 2006, 15:47

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.