Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin_qtbase/qtappbase/QAUndoStack.qt.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00031 namespace QtAppBase { 00032 00033 00034 typedef AppBase::Command<QString> QACommand; 00035 00036 00037 class QAUndoStack: public QUndoStack 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 virtual ~QAUndoStack() {} 00043 00044 public: 00045 void push(QACommand* cmd); 00046 00047 protected: 00048 class QACommandAdaptor: public QUndoCommand 00049 { 00050 public: 00051 QACommand(QACommand* command, QUndoCommand* parent = NULL); 00052 virtual ~QACommand() { delete o_command; } 00053 00054 public: 00055 virtual void undo(); //call QUndoCommand::undo(), then o_command->undo() 00056 virtual void redo(); //call o_command->redo(), then QUndoCommand::redo() 00057 virtual void setText(const QString& text); //call QUndoCommand::setName(), then o_command->setName() 00058 virtual QString text() const; //call o_command->getName() 00059 00060 protected: 00061 QACommand* o_command; 00062 }; 00063 00064 }; 00065 00066 00067 }
1.3.9.1