Polymorphic QSharedPointer
The Polymorphic QSharedPointer:
Click this link. qSharedPointerCast():
QSharedPointer <Switch> mySwitchTest= qSharedPointerCast<Switch>(myState);
By calling the staticCast() on smart pointer:
QSharedPointer <Switch> mySwitchTest= myState.staticCast<Switch>();
The equal of the version isstatic_cast on basic pointers.
The initialized answer is:
Here,the dynamic cast use the qSharedPointerDynamicCast:
class Derived : public Base { ... }; QSharedPointer<Base> base... QSharedPointer<Derived> derived = qSharedPointerDynamicCast<Derived>( base );
The static_cast is also an equivalents for qobject_cast and const_cast.