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

List:       kde-devel
Subject:    Re: QCanvasItem inheritance
From:       Thomas Capricelli <capricel () yalbi ! com>
Date:       2000-06-19 8:39:24
[Download RAW message or body]



	The QCanvasItem doesn't need the signal/slot or other QObject
mechanism (inherits(), timers.. ) and therefore does not inherit QObject. : it
would be an uneeded overhead for such an optimized class I guess. 

	If you need signal/slot, you need to make multiple inheritance as
you've proposed, but keep in mind (read the fine QT manual) that the QObject
need to be the first  inherited object so :

	class myclass : public QObject, public QCanvasItem

	I use this in my project (boson.eu.org) if you want to have a look at
an example.

regards,
Thomas


>I have a small question concerning the kde-qt-addon class
>QCanvasItem (in qcanvas.cpp/h).  I noticed that it inherits
>class Qt but not Class QObject, which does not allow one
>to use signal/slot handling. I suppose using multiple inheritance 
>like
>class myclass: public QCanvasItem, publicQObject 
>this could be solved but I wonder why the class does not directly
>inherit from QObject. 
>Can anyone explain this to me? And would the above mentioned
>method be correct to get the signal/slot thingy?
>
>Martin
> 
>>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
-- 

Thomas Capricelli <capricel@yalbi.com>
Yalbi - Sales Manager - www.yalbi.com
TEL : +33 1 45 81 81 59
GSM : +33 6 13 02 05 21
 
>> 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