Undo Framework

This example shows Qt’s undo framework in action

This example shows Qt’s undo framework in action.

Qt’s undo framework is an implementation of the Command pattern, which provides advanced undo/redo functionality.

To show the abilities of the framework, we have implemented a small diagram application in which the diagram items are geometric primitives. You can edit the diagram in the following ways: add, move, change the color of, and delete the items.

commands.cpp Example File

commands.h Example File

document.cpp Example File

document.h Example File

mainwindow.cpp Example File

mainwindow.h Example File

mainwindow.ui Example File

main.cpp Example File

undo.pro Example File

undo.qrc Example File

background.png Image File

blue.png Image File

circle.png Image File

exit.png Image File

fileclose.png Image File

filenew.png Image File

fileopen.png Image File

filesave.png Image File

green.png Image File

ok.png Image File

rectangle.png Image File

red.png Image File

redo.png Image File

remove.png Image File

triangle.png Image File

undo.png Image File