Progress notification

Thomas Zander zander at kde.org
Sat Oct 21 19:13:40 CEST 2006


On Saturday 21 October 2006 18:57, Cyrille Berger wrote:
> > pu->start(100);
> > Updater updater = pu->startSubtask();
> > where you can do things like:
> > updater.forward(10); // adds 10 percent to the progress of this subtask.
>
> How does the substask tell how much it cost ? Or is it up to the main
> filter to know that the overall cost ?

The startSubtask() I used above is using the default weight argument of 1.
If you have 3 tasks and the 3th is just a small one you can create them like 
this:
Updater smooth = pu->startSubtask(5);
Updater scale = pu->startSubtask(5);
Updater cleanup = pu->startSubtask(1);

Each individually still ranges from 0-100, but the effect will be scaled by 
the weight of each individual subtask in the total progress-count.

I do, however, require that all subtasks are created before you start work. I 
assume thats not an issue.
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20061021/ae02e989/attachment.pgp 


More information about the kimageshop mailing list