Possible bug in Qt code. Testing

Rafael Fernández López ereslibre at gmail.com
Sun Dec 10 15:26:57 GMT 2006


Hi again,

As David said, I shouldn't use the QPersistentModelIndexes, so I changed
code a bit. I think this code is easier to read but has some "worse" points.

1. On insertRow it is necessary to do an append for every QList that I have,
so some memory is wasted, since not all jobs will use all properties. I
mean, stating won't use progress, and some jobs won't use elapsedtime, or
so.

2. Since the delegate will have to draw different things depending on what
properties were set and what not (it won't draw the progress bar if any
progress was setted, because we suppose is not needed), is necessary to add
"dummy" default values to identify if they were set or not, when on the
other code, we just checked if the QHash had that role added or not.

Anyway this code seems to be much for clean, so I think is the best one, as
David said.

I would like you to point me what you think is wrong ATM (before continuing
the work). Take in count there are not lots of roles added, since this was
for testing, and it worked.

Thanks,
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061210/9645e1b0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: progresslistmodel.h
Type: text/x-chdr
Size: 2911 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061210/9645e1b0/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: progresslistmodel.cpp
Type: text/x-c++src
Size: 4562 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061210/9645e1b0/attachment.cpp>
-------------- next part --------------
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


More information about the kde-core-devel mailing list