It makes little sense to do that.
As wysota said, you code makes no functional sense, and unless you are taking care of your 'object_undo' pointer (which doesn't look like you do), you are leaking memory as well.
If what you want is an "undo" functionality, Qt has a built in framework for that:
http://doc.qt.nokia.com/latest/qundo.html
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks