PDA

View Full Version : QProgressBar + Mac OS X



THRESHE
12th December 2007, 18:51
Hi everyone.

I have a problem with QProgressBar in QTableWidget. It doesn't want to scale :confused:
On Windows it works the right way. I don't know what to do

jpn
12th December 2007, 19:09
How did you do it? With delegate or cell widget?

THRESHE
13th December 2007, 12:18
I did it with setCellWidget method

jpn
13th December 2007, 14:29
Well, I would recommend using the delegate approach. It's much more light-weight. :) Check out the torrent example (http://doc.trolltech.com/latest/network-torrent.html).

THRESHE
14th December 2007, 13:37
Could you tell me more about this "delegate aproach" ?

jpn
14th December 2007, 13:41
Take a look at TorrentViewDelegate::paint() in mainwindow.cpp (http://doc.trolltech.com/4.3/network-torrent-mainwindow-cpp.html). This approach makes it possible to render progress bars in item views without need of flooding it full of rather expensive index widgets. Also, there is no need to explicitly maintain geometry of index widgets (which seems to cause problems in your case).