scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

AspectChildMoveCmd Class Reference

#include <aspectcommands.h>

Inheritance diagram for AspectChildMoveCmd:
[legend]
Collaboration diagram for AspectChildMoveCmd:
[legend]

Public Member Functions

 AspectChildMoveCmd (AbstractAspect::Private *target, int from, int to)
 
virtual void redo ()
 
virtual void undo ()
 

Private Attributes

AbstractAspect::Privated_target
 
int d_from
 
int d_to
 

Detailed Description

Definition at line 167 of file aspectcommands.h.

Constructor & Destructor Documentation

◆ AspectChildMoveCmd()

AspectChildMoveCmd::AspectChildMoveCmd ( AbstractAspect::Private target,
int  from,
int  to 
)
inline

Definition at line 170 of file aspectcommands.h.

171  : d_target(target), d_from(from), d_to(to) {
172  setText(QObject::tr("%1: move child from position %2 to %3.").arg(d_target->name()).arg(d_from+1).arg(d_to+1));
173  }

References d_from, d_target, d_to, and AbstractAspect::Private::name().

Here is the call graph for this function:

Member Function Documentation

◆ redo()

virtual void AspectChildMoveCmd::redo ( )
inlinevirtual

Definition at line 175 of file aspectcommands.h.

175  {
176  // Moving in one go confuses QTreeView, so we would need another two signals
177  // to be mapped to QAbstractItemModel::layoutAboutToBeChanged() and ::layoutChanged().
178  AbstractAspect * child = d_target->child(d_from);
179  d_target->removeChild(child);
180  d_target->insertChild(d_to, child);
181  }

References AbstractAspect::Private::child(), d_from, d_target, d_to, AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

Here is the call graph for this function:

◆ undo()

virtual void AspectChildMoveCmd::undo ( )
inlinevirtual

Definition at line 183 of file aspectcommands.h.

183  {
184  AbstractAspect * child = d_target->child(d_to);
185  d_target->removeChild(child);
186  d_target->insertChild(d_from, child);
187  }

References AbstractAspect::Private::child(), d_from, d_target, d_to, AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

Here is the call graph for this function:

Member Data Documentation

◆ d_from

int AspectChildMoveCmd::d_from
private

Definition at line 191 of file aspectcommands.h.

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

◆ d_target

AbstractAspect::Private* AspectChildMoveCmd::d_target
private

Definition at line 190 of file aspectcommands.h.

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

◆ d_to

int AspectChildMoveCmd::d_to
private

Definition at line 191 of file aspectcommands.h.

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


The documentation for this class was generated from the following file:
AspectChildMoveCmd::d_to
int d_to
Definition: aspectcommands.h:191
AbstractAspect::Private::removeChild
int removeChild(AbstractAspect *child)
Definition: AspectPrivate.cpp:98
AspectChildMoveCmd::d_target
AbstractAspect::Private * d_target
Definition: aspectcommands.h:190
AbstractAspect::Private::name
QString name() const
Definition: AspectPrivate.cpp:122
AbstractAspect::Private::insertChild
void insertChild(int index, AbstractAspect *child)
Definition: AspectPrivate.cpp:61
AbstractAspect::Private::child
AbstractAspect * child(int index)
Definition: AspectPrivate.cpp:116
AspectChildMoveCmd::d_from
int d_from
Definition: aspectcommands.h:191
AbstractAspect
Base class of all persistent objects in a Project.
Definition: AbstractAspect.h:86