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)  

AspectChildRemoveCmd Class Reference

#include <aspectcommands.h>

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

Public Member Functions

 AspectChildRemoveCmd (AbstractAspect::Private *target, AbstractAspect *child, bool detach)
 
 ~AspectChildRemoveCmd ()
 
virtual void redo ()
 
virtual void undo ()
 

Protected Attributes

AbstractAspect::Privated_target
 
AbstractAspectd_child
 
int d_index
 
bool d_removed
 
bool d_detach
 

Detailed Description

Definition at line 121 of file aspectcommands.h.

Constructor & Destructor Documentation

◆ AspectChildRemoveCmd()

AspectChildRemoveCmd::AspectChildRemoveCmd ( AbstractAspect::Private target,
AbstractAspect child,
bool  detach 
)
inline

Definition at line 124 of file aspectcommands.h.

125  : d_target(target), d_child(child), d_index(-1), d_removed(false), d_detach(detach) {
126  setText(QObject::tr("%1: remove %2").arg(d_target->name()).arg(d_child->name()));
127  }

References d_child, d_target, AbstractAspect::name(), and AbstractAspect::Private::name().

Here is the call graph for this function:

◆ ~AspectChildRemoveCmd()

AspectChildRemoveCmd::~AspectChildRemoveCmd ( )
inline

Definition at line 128 of file aspectcommands.h.

128  {
129  if (d_removed && !d_detach)
130  delete d_child;
131  }

References d_child, d_detach, and d_removed.

Member Function Documentation

◆ redo()

virtual void AspectChildRemoveCmd::redo ( )
inlinevirtual

Reimplemented in AspectChildAddCmd.

Definition at line 134 of file aspectcommands.h.

134  {
136  d_removed = true;
137  }

References d_child, d_index, d_removed, d_target, and AbstractAspect::Private::removeChild().

Referenced by AspectChildAddCmd::undo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ undo()

virtual void AspectChildRemoveCmd::undo ( )
inlinevirtual

Reimplemented in AspectChildAddCmd.

Definition at line 140 of file aspectcommands.h.

140  {
141  Q_ASSERT(d_index != -1); // d_child must be a child of d_target->owner()
143  d_removed = false;
144  }

References d_child, d_index, d_removed, d_target, and AbstractAspect::Private::insertChild().

Referenced by AspectChildAddCmd::redo().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ d_child

AbstractAspect* AspectChildRemoveCmd::d_child
protected

◆ d_detach

bool AspectChildRemoveCmd::d_detach
protected

Definition at line 150 of file aspectcommands.h.

Referenced by ~AspectChildRemoveCmd().

◆ d_index

int AspectChildRemoveCmd::d_index
protected

Definition at line 149 of file aspectcommands.h.

Referenced by AspectChildAddCmd::AspectChildAddCmd(), redo(), and undo().

◆ d_removed

bool AspectChildRemoveCmd::d_removed
protected

Definition at line 150 of file aspectcommands.h.

Referenced by redo(), undo(), and ~AspectChildRemoveCmd().

◆ d_target

AbstractAspect::Private* AspectChildRemoveCmd::d_target
protected

The documentation for this class was generated from the following file:
AspectChildRemoveCmd::d_index
int d_index
Definition: aspectcommands.h:149
AspectChildRemoveCmd::d_detach
bool d_detach
Definition: aspectcommands.h:150
AspectChildRemoveCmd::d_child
AbstractAspect * d_child
Definition: aspectcommands.h:148
AbstractAspect::Private::removeChild
int removeChild(AbstractAspect *child)
Definition: AspectPrivate.cpp:98
AspectChildRemoveCmd::d_removed
bool d_removed
Definition: aspectcommands.h:150
AbstractAspect::name
QString name() const
Definition: AbstractAspect.cpp:229
AbstractAspect::Private::name
QString name() const
Definition: AspectPrivate.cpp:122
AbstractAspect::Private::insertChild
void insertChild(int index, AbstractAspect *child)
Definition: AspectPrivate.cpp:61
AspectChildRemoveCmd::d_target
AbstractAspect::Private * d_target
Definition: aspectcommands.h:147