I have a class Historymanager, that has an attribute of type QUndoStack. I can get the undoStack with a getter that returns
QSharedPointer<QUndoStack>
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?
I tried:
connect((historyManager->getQUndoStack().data()),
SIGNAL(canRedoChanged()), this, SLOT(onCanRedoChanged()));
but that doesn't do the trick. I also tried
connect(*(historyManager->getQUndoStack().data()),
SIGNAL(canRedoChanged()), this, SLOT(onCanRedoChanged()));
to dereference the historyManager->getQUndoStack().data() by putting a "*" before, but that gives a compile error.
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
const QObject *sender
What do I need to do here?