Polymorphic QSharedPointer

Viewed 12037

I'm trying to use QSharedPointer in my polymorphic stucture, but I couldn't find right syntax to convert pointer of base class to pointer of derived class.

struct Switch : State {
 int a;
};

QSharedPointer <State> myState=QSharedPointer <State>(new Switch);  

QSharedPointer <Switch> mySwitchTest= ??? myState;

What should I put in the place of ???

2 Answers
Related