Results 1 to 2 of 2

Thread: Custom progress bar background for list items

  1. #1
    Join Date
    Sep 2011
    Qt products

    Default Custom progress bar background for list items

    I'd like to draw a custom background for items in a table widget that shows a visual representation of some progress. Maybe some pseudocode will explain it better:

    Qt Code:
    1. CustomProgressBar pb;
    2. pb.setColor(LIGHT_GREEN); // set progress bar color to light green
    3. pb.setHeight(100); // consume 100% of space vertically
    4. pb.setWidth(30); // consume 30% of space horizontally
    5. pb.setAutoResize(true); // resize progress bar if parent item is resized
    7. newItem->setBackground(pb);
    8. newItem->setText("My Movie Watchlist (30% Completed)");
    To copy to clipboard, switch view to plain text mode 

    Here's what it's supposed to look like with HTML/CSS:

    What do I need in order to do this?


  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: Custom progress bar background for list items

    A custom delegate.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Replies: 1
    Last Post: 23rd April 2011, 18:33
  2. Replies: 1
    Last Post: 29th November 2010, 18:22
  3. Qt Kinetic: adding items to list
    By Diph in forum Qt Programming
    Replies: 1
    Last Post: 10th November 2009, 09:27
  4. Comparing Items In List Box
    By kenny_isles in forum Qt Programming
    Replies: 9
    Last Post: 21st February 2007, 14:06
  5. delete items from list box
    By vvbkumar in forum Qt Programming
    Replies: 4
    Last Post: 23rd June 2006, 20:08


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.