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

List:       kde-devel
Subject:    Re: RTTI / dynamic casts in KDE?
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2002-01-29 0:29:30
[Download RAW message or body]

On Mon, Jan 28, 2002 at 11:08:02PM +0000, Manuel Arriaga wrote:
> > That's why for QObject inherited classes using qt_cast is prefered.
> 
> I just searched the Qt-2.3.1 docs and source and couldn't find any reference 
> to qt_cast; google wasn't much useful either, only returning a few obscure 
> references (in source code) in addition to your own posts in the GCC 
> discussion you linked to. Do you know where I can learn about it?

qt_cast is an undocumented method of QObject that has been
introduced with Qt 3 . The Q_OBJECT is what expands it, so you might
want to have a look at qobjectdefs.h for the signature and at moc
generated code for an implementation (moc generates this method and
fills it with information about what classes the specific class
inherits) . The plain use of it is probably a bad idea because it is
syntactically not meant to be used by 'users' I think (it requires
an re-interpret cast) . I don't think anyone has found a nice
template wrapper, yet. (mostly because it requires passing duplicate
information twice, once the class name as identifier and once as
string)


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