qdesigner_internal::AddMenuActionCommand Class Reference

#include <qdesigner_command_p.h>

Inheritance diagram for qdesigner_internal::AddMenuActionCommand:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 1038 of file qdesigner_command_p.h.

Public Member Functions

 AddMenuActionCommand (QDesignerFormWindowInterface *formWindow)
void init (QAction *action, QWidget *parent)
virtual void redo ()
virtual void undo ()

Private Attributes

QActionm_action
QWidgetm_parent


Constructor & Destructor Documentation

qdesigner_internal::AddMenuActionCommand::AddMenuActionCommand ( QDesignerFormWindowInterface formWindow  ) 

Definition at line 2756 of file qdesigner_command.cpp.

References m_action, and m_parent.

02757     : QDesignerFormWindowCommand(QApplication::translate("Command", "Add menu"), formWindow)
02758 {
02759     m_action = 0;
02760     m_parent = 0;
02761 }


Member Function Documentation

void qdesigner_internal::AddMenuActionCommand::init ( QAction action,
QWidget parent 
)

Definition at line 2763 of file qdesigner_command.cpp.

References m_action, m_parent, and QAction::menu().

Referenced by QDesignerMenuBar::createAction().

02764 {
02765     Q_ASSERT(action->menu() != 0);
02766     m_action = action;
02767     m_parent = parent;
02768 }

Here is the call graph for this function:

void qdesigner_internal::AddMenuActionCommand::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 2770 of file qdesigner_command.cpp.

References QDesignerMetaDataBaseInterface::add(), qdesigner_internal::QDesignerFormWindowCommand::cheapUpdate(), qdesigner_internal::QDesignerFormWindowCommand::core(), m_action, QAction::menu(), QDesignerFormEditorInterface::metaDataBase(), QDesignerFormEditorInterface::propertyEditor(), and QDesignerPropertyEditorInterface::setObject().

02771 {
02772     core()->metaDataBase()->add(m_action);
02773     core()->metaDataBase()->add(m_action->menu());
02774 
02775     core()->propertyEditor()->setObject(m_action->menu());
02776     cheapUpdate();
02777 }

Here is the call graph for this function:

void qdesigner_internal::AddMenuActionCommand::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 2779 of file qdesigner_command.cpp.

References qdesigner_internal::QDesignerFormWindowCommand::cheapUpdate(), qdesigner_internal::QDesignerFormWindowCommand::core(), m_action, m_parent, QAction::menu(), QDesignerFormEditorInterface::metaDataBase(), QDesignerFormEditorInterface::propertyEditor(), QDesignerMetaDataBaseInterface::remove(), and QDesignerPropertyEditorInterface::setObject().

02780 {
02781     core()->metaDataBase()->remove(m_action->menu());
02782     core()->metaDataBase()->remove(m_action);
02783 
02784     core()->propertyEditor()->setObject(m_parent);
02785     cheapUpdate();
02786 }

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 1047 of file qdesigner_command_p.h.

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

QWidget* qdesigner_internal::AddMenuActionCommand::m_parent [private]

Definition at line 1048 of file qdesigner_command_p.h.

Referenced by AddMenuActionCommand(), init(), and undo().


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