title: QPointer for abstract base class
body: <p>I am writing an expression-parsing library.
  It is written with Qt, and I have a class structure like this:<br>
  <code>QCExpressionNode</code>-Abstract Base Class for all pieces of an expression<br>
  <code>QCConstantNode</code>-Constants in an expression (extends <code>QCExpressionNode</code>)<br>
  <code>QCVariableNode</code>-Variables in an expression (extends <code>QCExpressionNode</code>)<br>
  <code>QCBinaryOperatorNode</code>-Binary Addition, Subtraction, Multiplication, Division and Power operators (extends <code>QCExpressionNode</code>)</p>
  
  <p>I would like to be able to use smart pointers (like <code>QPointer</code> or <code>QSharedPointer</code>), but I am running into the following challenges:<br>
  -Can a <code>QPointer</code> be used with abstract classes? If so, please provide examples.<br>
  -How to cast a <code>QPointer</code> to a concrete subclass?</p>