[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: d pointer problems
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2005-03-15 10:12:58
Message-ID: 200503151112.58769.kde () carewolf ! com
[Download RAW message or body]

On Tuesday 15 March 2005 09:09, André Somers wrote:
> Hi,
>
> I remember reading a blog recently about the useage of the d pointer
> technique to keep a lib bc. I have run into this technique also when trying
> to modify the behaviour of Qt classes. The problem I've run into is that,
> as far as I can see, the d pointer system makes it very hard to do
> effective subclassing. Even if method is virtual, if it uses this private
> pointer to do essential things, it is no longer possible to reproduce that
> behaviour in your subclass in order to modify it slightly. I find this very
> annoying to be honest. As this technique was advocated recently for use in
> KDE, I can't help but wondering: did I miss something? Is there some trick
> that makes it possible to access that data anyway?
>
The d pointer as described is used to store "private" data, so it shouldn't be 
accesible to derived classes. If you need public or proteced data, you should 
add access functions to set and get the data.

`Allan
 
>> Visit http://mail.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