qdesigner_internal::AdjustConnectionCommand Class Reference

Inheritance diagram for qdesigner_internal::AdjustConnectionCommand:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 144 of file connectionedit.cpp.

Public Member Functions

 AdjustConnectionCommand (ConnectionEdit *edit, Connection *con, const QPoint &old_source_pos, const QPoint &old_target_pos, const QPoint &new_source_pos, const QPoint &new_target_pos)
virtual void redo ()
virtual void undo ()

Private Attributes

Connectionm_con
QPoint m_old_source_pos
QPoint m_old_target_pos
QPoint m_new_source_pos
QPoint m_new_target_pos


Constructor & Destructor Documentation

qdesigner_internal::AdjustConnectionCommand::AdjustConnectionCommand ( ConnectionEdit edit,
Connection con,
const QPoint old_source_pos,
const QPoint old_target_pos,
const QPoint new_source_pos,
const QPoint new_target_pos 
)

Definition at line 160 of file connectionedit.cpp.

References m_con, m_new_source_pos, m_new_target_pos, m_old_source_pos, m_old_target_pos, QUndoCommand::setText(), and QCoreApplication::translate().

00165     : CECommand(edit)
00166 {
00167     setText(QApplication::translate("Command", "Adjust connection"));
00168     m_con = con;
00169     m_old_source_pos = old_source_pos;
00170     m_old_target_pos = old_target_pos;
00171     m_new_source_pos = new_source_pos;
00172     m_new_target_pos = new_target_pos;
00173 }

Here is the call graph for this function:


Member Function Documentation

void qdesigner_internal::AdjustConnectionCommand::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 181 of file connectionedit.cpp.

References m_con, m_new_source_pos, m_new_target_pos, qdesigner_internal::Connection::setEndPoint(), and qdesigner_internal::Connection::widget().

00182 {
00183     m_con->setEndPoint(EndPoint::Source, m_con->widget(EndPoint::Source), m_new_source_pos);
00184     m_con->setEndPoint(EndPoint::Target, m_con->widget(EndPoint::Target), m_new_target_pos);
00185 }

Here is the call graph for this function:

void qdesigner_internal::AdjustConnectionCommand::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 175 of file connectionedit.cpp.

References m_con, m_old_source_pos, m_old_target_pos, qdesigner_internal::Connection::setEndPoint(), and qdesigner_internal::Connection::widget().

00176 {
00177     m_con->setEndPoint(EndPoint::Source, m_con->widget(EndPoint::Source), m_old_source_pos);
00178     m_con->setEndPoint(EndPoint::Target, m_con->widget(EndPoint::Target), m_old_target_pos);
00179 }

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 155 of file connectionedit.cpp.

Referenced by AdjustConnectionCommand(), redo(), and undo().

QPoint qdesigner_internal::AdjustConnectionCommand::m_old_source_pos [private]

Definition at line 156 of file connectionedit.cpp.

Referenced by AdjustConnectionCommand(), and undo().

QPoint qdesigner_internal::AdjustConnectionCommand::m_old_target_pos [private]

Definition at line 156 of file connectionedit.cpp.

Referenced by AdjustConnectionCommand(), and undo().

QPoint qdesigner_internal::AdjustConnectionCommand::m_new_source_pos [private]

Definition at line 156 of file connectionedit.cpp.

Referenced by AdjustConnectionCommand(), and redo().

QPoint qdesigner_internal::AdjustConnectionCommand::m_new_target_pos [private]

Definition at line 156 of file connectionedit.cpp.

Referenced by AdjustConnectionCommand(), and redo().


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