qdesigner_internal::AddActionCommand Class Reference

#include <qdesigner_command_p.h>

Inheritance diagram for qdesigner_internal::AddActionCommand:

Inheritance graph
[legend]
Collaboration diagram for qdesigner_internal::AddActionCommand:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 969 of file qdesigner_command_p.h.

Public Member Functions

 AddActionCommand (QDesignerFormWindowInterface *formWindow)
void init (QAction *action)
virtual void redo ()
virtual void undo ()

Private Attributes

QActionm_action


Constructor & Destructor Documentation

qdesigner_internal::AddActionCommand::AddActionCommand ( QDesignerFormWindowInterface formWindow  ) 

Definition at line 2576 of file qdesigner_command.cpp.

References m_action.

02577     : QDesignerFormWindowCommand(QLatin1String("Add action"), formWindow)
02578 {
02579     m_action = 0;
02580 }


Member Function Documentation

void qdesigner_internal::AddActionCommand::init ( QAction action  ) 

Definition at line 2582 of file qdesigner_command.cpp.

References m_action.

Referenced by QDesignerToolBar::createAction(), QDesignerMenu::createAction(), and qdesigner_internal::ActionEditor::slotNewAction().

02583 {
02584     Q_ASSERT(m_action == 0);
02585     m_action = action;
02586 }

void qdesigner_internal::AddActionCommand::redo (  )  [virtual]

Applies a change to the document. This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this funciton leads to undefined beahavior.

The default implementation calls redo() on all child commands.

See also:
undo()

Reimplemented from qdesigner_internal::QDesignerFormWindowCommand.

Definition at line 2588 of file qdesigner_command.cpp.

References QDesignerFormEditorInterface::actionEditor(), qdesigner_internal::QDesignerFormWindowCommand::core(), qdesigner_internal::QDesignerFormWindowCommand::formWindow(), m_action, QDesignerActionEditorInterface::manageAction(), and QDesignerActionEditorInterface::setFormWindow().

02589 {
02590     core()->actionEditor()->setFormWindow(formWindow());
02591     core()->actionEditor()->manageAction(m_action);
02592 }

Here is the call graph for this function:

void qdesigner_internal::AddActionCommand::undo (  )  [virtual]

Reverts a change to the document. After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling QUndoStack::push(), QUndoStack::undo() or QUndoStack::redo() from this funciton leads to undefined beahavior.

The default implementation calls undo() on all child commands in reverse order.

See also:
redo()

Reimplemented from qdesigner_internal::QDesignerFormWindowCommand.

Definition at line 2594 of file qdesigner_command.cpp.

References QDesignerFormEditorInterface::actionEditor(), qdesigner_internal::QDesignerFormWindowCommand::core(), qdesigner_internal::QDesignerFormWindowCommand::formWindow(), m_action, QDesignerActionEditorInterface::setFormWindow(), and QDesignerActionEditorInterface::unmanageAction().

02595 {
02596     core()->actionEditor()->setFormWindow(formWindow());
02597     core()->actionEditor()->unmanageAction(m_action);
02598 }

Here is the call graph for this function:


Member Data Documentation

QAction* qdesigner_internal::AddActionCommand::m_action [private]

Definition at line 978 of file qdesigner_command_p.h.

Referenced by AddActionCommand(), init(), redo(), and undo().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 20:46:36 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1