[Kmymoney-devel] Payees view

Alvaro Soliverez asoliverez at gmail.com
Wed Mar 3 02:18:50 CET 2010

On Tue, Mar 2, 2010 at 9:10 AM, Alvaro Soliverez <asoliverez at gmail.com> wrote:
> On Tue, Mar 2, 2010 at 7:25 AM, Cristian Oneţ <onet.cristian at gmail.com> wrote:
>> On Tue, Mar 2, 2010 at 11:53 AM, Alvaro Soliverez <asoliverez at gmail.com> wrote:
>>> Hello all,
>>> I've just commited a major change to the payees view, to port it to a
>>> Qt4 widget.
>>> There are probably some issues still to be solved, so please keep your
>>> eyes open.
>>> As usual, feedback is welcome!
>> I'll keep an eye for any issues :).
>> So now that we've done this for a few lists I see that the way the
>> code was written and then ported requires a lot of dynamic_casts in
>> order to get to the specific item which stores the business logic
>> specific data (for instance an id). I think the code would be much
>> cleaner without these routine casts so I propose the following simple
>> steps to get rid of them:
>> 1. Don't use an implementation specific item.
>> 2. Store the data that was previously a member of the implementation
>> specific item in the QTree(List)WidgetItem using the setData and data
>> functions and a user role definition for each implementation specific
>> data
>> Any thoughts?
> I agree. We should move all that data to the models, which is my next
> step in the port.
> Can I use the accounts model as an example? Any recommendations?

There is an opportunity to show this approach in the
kaccounttemplateselector widget.
It is a K3ListView which does not refresh correctly in KDE 4.4 and it
subclasses the item widget.

The list should subclass QTreeWidget, but the items should not be
subclassed and all the logic and data should be moved to a model

Do you want me to make the honor or do you want to go for it?


More information about the KMyMoney-devel mailing list