qdesigner_internal::AddConnectionCommand Class Reference

#include <connectionedit_p.h>

Inheritance diagram for qdesigner_internal::AddConnectionCommand:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 266 of file connectionedit_p.h.

Public Member Functions

 AddConnectionCommand (ConnectionEdit *edit, Connection *con)
virtual void redo ()
virtual void undo ()

Private Attributes

Connectionm_con


Constructor & Destructor Documentation

qdesigner_internal::AddConnectionCommand::AddConnectionCommand ( ConnectionEdit edit,
Connection con 
)

Definition at line 117 of file connectionedit.cpp.

References QUndoCommand::setText(), and QCoreApplication::translate().

00118     : CECommand(edit), m_con(con)
00119 {
00120     setText(QApplication::translate("Command", "Add connection"));
00121 }

Here is the call graph for this function:


Member Function Documentation

void qdesigner_internal::AddConnectionCommand::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 QUndoCommand.

Definition at line 123 of file connectionedit.cpp.

References qdesigner_internal::ConnectionEdit::aboutToAddConnection(), QList< T >::append(), qdesigner_internal::ConnectionEdit::connectionAdded(), qdesigner_internal::CECommand::edit(), emit, qdesigner_internal::Connection::inserted(), m_con, qdesigner_internal::ConnectionEdit::m_con_list, qdesigner_internal::ConnectionEdit::selectNone(), qdesigner_internal::ConnectionEdit::setSelected(), and QWidget::size().

Referenced by qdesigner_internal::BuddyEditor::updateBackground().

00124 {
00125     edit()->selectNone();
00126     emit edit()->aboutToAddConnection(edit()->m_con_list.size());
00127     edit()->m_con_list.append(m_con);
00128     m_con->inserted();
00129     edit()->setSelected(m_con, true);
00130     emit edit()->connectionAdded(m_con);
00131 }

Here is the call graph for this function:

void qdesigner_internal::AddConnectionCommand::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 QUndoCommand.

Definition at line 133 of file connectionedit.cpp.

References qdesigner_internal::ConnectionEdit::aboutToRemoveConnection(), qdesigner_internal::ConnectionEdit::connectionRemoved(), qdesigner_internal::CECommand::edit(), emit, qdesigner_internal::ConnectionEdit::indexOfConnection(), m_con, qdesigner_internal::ConnectionEdit::m_con_list, QList< T >::removeAll(), qdesigner_internal::Connection::removed(), qdesigner_internal::ConnectionEdit::setSelected(), and qdesigner_internal::Connection::update().

00134 {
00135     int idx = edit()->indexOfConnection(m_con);
00136     emit edit()->aboutToRemoveConnection(m_con);
00137     edit()->setSelected(m_con, false);
00138     m_con->update();
00139     m_con->removed();
00140     edit()->m_con_list.removeAll(m_con);
00141     emit edit()->connectionRemoved(idx);
00142 }

Here is the call graph for this function:


Member Data Documentation

Connection* qdesigner_internal::AddConnectionCommand::m_con [private]

Definition at line 273 of file connectionedit_p.h.

Referenced by redo(), and undo().


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