[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: QList problem
From: David Faure <david () mandrakesoft ! com>
Date: 2001-06-06 13:46:01
[Download RAW message or body]
On Wednesday 06 June 2001 16:42, Stephan Oehlert wrote:
> Hi
>
> you are right, and Mike Pilone already helped me with this. The problem was
> that c++ doesn't support overloading by return type and I didn't know how to
> handle it.
> Is having only one viewList better than having a separate one for every
> derived view there is?
For every derived doc, I suppose you mean.
Well, I think both approaches are valid.
With views in the base class, you can handle adding/removing/.. from there
(like in KOffice). But you get to cast often (see below).
With views in the derived class, the responsibilities might not be very clear
(who adds/removes/etc. ?).
> Isn't it a problem to have only one list since you
> cannot separate them based on their type (baseView)?
That's where RTTI can help, for instance (dynamic_cast etc.),
or you can do it manually with a int type() or whatever else.
--
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic