[Qt-interest] qobject_cast Vs dynamic_cast

程梁 chengliang.soft at gmail.com
Thu Oct 21 09:05:52 CEST 2010


In my opinion, the best way to understand the implementation signals and
slots is to read source code. You can check the marco SIGNALS and SLOTS. The
SIGNALS makes function name to a string. I found Qt maintains a SIGNAL-SLOT
map. In fact, when Qt found an emit keyword, it will change it to the slot
function.

2010/10/21 Sarvesh Saran <Sarvesh.Saran at synopsys.com>

>  Hi All,
>
>
>
> I am trying to understand the differences between the qobject_cast  and
> dynamic_cast and the advantages offered by qobject_cast.
>
>
>
> According to QT documentation:
>
>
>
> The qobject_cast() function behaves similarly to the standard C++
> dynamic_cast(), with the advantages that it doesn't require RTTI support
> and *it works across dynamic library boundaries*.
>
>
>
> Can someone explain the meaning of the underlined words “it works across
> dynamic library boundaries” ?
>
>
>
> I have another question,  related to signals and slots. I will appreciate
> it if someone can give a conceptual overview of how QT implements signals
> and slots internally?  ( the documentation says that we don’t use templates
> as certain compilers do not support  advanced templates ). I was just
> curious how signals and slots work under the hood.
>
>
>
> Thanks!
>
> Sarvesh
>
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
Cheng Liang
from: chengliang.soft at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101021/473bb370/attachment.html 


More information about the Qt-interest-old mailing list