title: Qt Signal: Dereference QSharedPointer
body: <p>I have a class Historymanager, that has an attribute of type QUndoStack.
  I can get the undoStack with a getter that returns </p>
  
  <pre><code>QSharedPointer&lt;QUndoStack&gt;
  </code></pre>
  
  <p>Now in a different class C, I have access to the historymanager and need to connect the signal canRedoChanged(bool) to a method from that class. The problem is: How do I tell the connect method the sender?</p>
  
  <p>I tried:</p>
  
  <pre><code>        connect((historyManager-&gt;getQUndoStack().data()),
                   SIGNAL(canRedoChanged()), this, SLOT(onCanRedoChanged()));
  </code></pre>
  
  <p>but that doesn't do the trick. I also tried</p>
  
  <pre><code>           connect(*(historyManager-&gt;getQUndoStack().data()),
                   SIGNAL(canRedoChanged()), this, SLOT(onCanRedoChanged()));
  </code></pre>
  
  <p>to dereference the historyManager->getQUndoStack().data() by putting a "*" before, but that gives a compile error.</p>
  
  <p>The way it is now Qt keeps telling me that there is no signal canRedoChanged, even though qundostack.h definitely provides it.
  The connect method requires the first argument to be </p>
  
  <pre><code> const QObject *sender
  </code></pre>
  
  <p>What do I need to do here?</p>