What exactly are you after? Doing undos and redos is very specific to the task at hand.
I create a base class that stores info on where a value came from ( a QWidget* ). Then in some derived classes add specifics about the values ( creating a derived that say takes doubles, one that takes QString, one that takes ... well you get the idea ). Then in the widgets If the value changes they create a derived class and emit a base class pointer the derived class as a signal.
In the main class I attach the widgets signal to a slot. This slot takes the base class pointer and adds it to a QPtrList. If the list count reaches what ever maximum is decided I pop off the front of the list.
Now when undo is pressed I pop off the last pointer added then call a function in the widget specified by the pointer in the base class. Of course the function in the widget then does a dynamic cast and reclaims the old value. Once this has returned, I then add the base class pointer to a second QPtrList, which is for redo. Which of course behave almost exactly the same as undo.
This is a basic undo/redo mechanism. The derived class could say take another class as a value, or multiple values. As long as the widget knows what to do with the pointer.
If this is not what you meant, or I didn't explain myself properly
let me know.