#include <qdesigner_command_p.h>
Inheritance diagram for qdesigner_internal::InsertActionIntoCommand:


Definition at line 1004 of file qdesigner_command_p.h.
Public Member Functions | |
| InsertActionIntoCommand (QDesignerFormWindowInterface *formWindow) | |
| void | init (QWidget *parentWidget, QAction *action, QAction *beforeAction, bool update=true) |
| virtual void | redo () |
| virtual void | undo () |
Private Attributes | |
| QWidget * | m_parentWidget |
| QAction * | m_action |
| QAction * | m_beforeAction |
| bool | m_update |
| qdesigner_internal::InsertActionIntoCommand::InsertActionIntoCommand | ( | QDesignerFormWindowInterface * | formWindow | ) |
Definition at line 2660 of file qdesigner_command.cpp.
Referenced by QDesignerMenuBar::dropEvent(), QDesignerMenuBar::leaveEditMode(), QDesignerMenuBar::startDrag(), and QDesignerMenuBar::swap().
02661 : QDesignerFormWindowCommand(QApplication::translate("Command", "Add action"), formWindow), 02662 m_parentWidget(0), m_action(0), m_beforeAction(0) 02663 { 02664 }
| void qdesigner_internal::InsertActionIntoCommand::init | ( | QWidget * | parentWidget, | |
| QAction * | action, | |||
| QAction * | beforeAction, | |||
| bool | update = true | |||
| ) |
Definition at line 2666 of file qdesigner_command.cpp.
References m_action, m_beforeAction, m_parentWidget, and m_update.
Referenced by QDesignerToolBar::dropEvent(), QDesignerMenu::dropEvent(), QDesignerMenuBar::dropEvent(), QDesignerMenu::enterEditMode(), QDesignerMenuBar::leaveEditMode(), QDesignerMenu::leaveEditMode(), QDesignerToolBar::slotInsertSeparator(), QDesignerMenu::startDrag(), QDesignerToolBar::startDrag(), QDesignerMenu::swap(), and QDesignerMenuBar::swap().
02668 { 02669 Q_ASSERT(m_parentWidget == 0); 02670 Q_ASSERT(m_action == 0); 02671 02672 m_parentWidget = parentWidget; 02673 m_action = action; 02674 m_beforeAction = beforeAction; 02675 m_update = update; 02676 }
| void qdesigner_internal::InsertActionIntoCommand::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.
Reimplemented from qdesigner_internal::QDesignerFormWindowCommand.
Definition at line 2678 of file qdesigner_command.cpp.
References qdesigner_internal::QDesignerFormWindowCommand::cheapUpdate(), qdesigner_internal::QDesignerFormWindowCommand::core(), QWidget::insertAction(), m_action, m_beforeAction, m_parentWidget, m_update, QDesignerFormEditorInterface::propertyEditor(), and QDesignerPropertyEditorInterface::setObject().
02679 { 02680 Q_ASSERT(m_action != 0); 02681 Q_ASSERT(m_parentWidget != 0); 02682 02683 m_parentWidget->insertAction(m_beforeAction, m_action); 02684 02685 if (m_update) { 02686 core()->propertyEditor()->setObject(m_action); 02687 cheapUpdate(); 02688 } 02689 }
Here is the call graph for this function:

| void qdesigner_internal::InsertActionIntoCommand::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.
Reimplemented from qdesigner_internal::QDesignerFormWindowCommand.
Definition at line 2691 of file qdesigner_command.cpp.
References qdesigner_internal::QDesignerFormWindowCommand::cheapUpdate(), qdesigner_internal::QDesignerFormWindowCommand::core(), m_action, m_parentWidget, m_update, QDesignerFormEditorInterface::propertyEditor(), and QDesignerPropertyEditorInterface::setObject().
02692 { 02693 Q_ASSERT(m_action != 0); 02694 Q_ASSERT(m_parentWidget != 0); 02695 02696 if (QDesignerMenu *menu = qobject_cast<QDesignerMenu*>(m_parentWidget)) 02697 menu->hideSubMenu(); 02698 02699 m_parentWidget->removeAction(m_action); 02700 02701 if (m_update) { 02702 core()->propertyEditor()->setObject(m_parentWidget); 02703 cheapUpdate(); 02704 } 02705 }
Here is the call graph for this function:

bool qdesigner_internal::InsertActionIntoCommand::m_update [private] |
1.5.1