PDA

View Full Version : Inserting progress bar as an item



kremuwa
4th April 2010, 18:55
Hi, i'm working on the p2m client. I've got a table which represents files that are currently downloaded. One of the table's columns is "Progress". I want to have a progress bar in this columns, which would indicate how many percent of the file size has been already downloaded. I just don't know how to put something like QProgressBar object as a table's item. That's what I want to ask you about :).

Kumosan
5th April 2010, 21:41
Search through the torrent example in Qt examples. This rudimentary bittorrent client is exactly doing that using a delegate.

faldzip
5th April 2010, 23:15
The simplest and most efficient is to subclass QStyledItemDelegate and draw progress bar with QStylePainter - look at its and QStyle's reference (drawControl() is probably the method you want.