[Interest] qobject_cast

Igor Mironchik igor.mironchik at gmail.com
Thu Apr 20 07:03:38 CEST 2017


Hi,


20.04.2017 7:52, Ch'Gans пишет:
> On 20 April 2017 at 16:38, Igor Mironchik <igor.mironchik at gmail.com> wrote:
>> Hi,
>>
>> What the benefits of qobject_cast<> on simple static_cast<>? Or there is no
> qobject_cast
> - works only on QObject (obviously)
> - returns nullptr if the object cannot be casted to the required type

And it can fail if QObject derived pointer was returned from plugin.

> - doesn't relies on RTTI, and is way faster than dynamic cast

This is understandable. But with comparison with static cast there are 
no benefits?

>
> Chris
>
>> one?
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list