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

List:       kde-devel
Subject:    Re: Programming question
From:       Peter Putzer <pputzer () edu ! uni-klu ! ac ! at>
Date:       2001-01-26 17:58:22
[Download RAW message or body]

On Thu, 25 Jan 2001, Harri Porten wrote:

> Michael Jarrett wrote:
> > 
> > What I meant is the parent class needs to have signals as well. Ie ObjA
> > inheriting KMainWindow and Obj2 where Obj2 would like to inherit
> > QWidget. Obj2 has to work independantly as a widget, but I also want to
> > inherit the functionality into ObjA, as so to avoid duplicating the
> > code.
> 
> Can't you compose those classes by making on a member variable of the
> other ? This way you don't have to duplicate any code except some
> connect() calls to forward signals.

Or put the functionality into concrete class C, and inherit that from your
subclass of KMainWindow and QObject... But I would advise to use
composition instead of inheritance in this case, if at all possible :)

bye,
Peter

 
>> 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