Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShape::Private::DependeesLifetimeListener Struct Reference
+ Inheritance diagram for KoShape::Private::DependeesLifetimeListener:

Public Member Functions

 DependeesLifetimeListener (QList< KoShape * > &dependees)
 
void notifyShapeChanged (KoShape::ChangeType type, KoShape *shape) override
 
- Public Member Functions inherited from KoShape::ShapeChangeListener
virtual ~ShapeChangeListener ()
 

Private Attributes

QList< KoShape * > & m_dependees
 

Detailed Description

A special listener class to track the lifetime of the dependees and remove them from the notification list when they are deleted

Definition at line 73 of file KoShape_p.h.

Constructor & Destructor Documentation

◆ DependeesLifetimeListener()

KoShape::Private::DependeesLifetimeListener::DependeesLifetimeListener ( QList< KoShape * > & dependees)
inline

Definition at line 75 of file KoShape_p.h.

77 {
78 }
QList< KoShape * > dependees
list of shape dependent on this shape
Definition KoShape_p.h:98

Member Function Documentation

◆ notifyShapeChanged()

void KoShape::Private::DependeesLifetimeListener::notifyShapeChanged ( KoShape::ChangeType type,
KoShape * shape )
inlineoverridevirtual

Implements KoShape::ShapeChangeListener.

Definition at line 80 of file KoShape_p.h.

80 {
81 if (type == KoShape::Deleted && m_dependees.contains(shape)) {
82 m_dependees.removeOne(shape);
83 // the listener will be unlinked on destruction automatically
84 }
85 }
@ Deleted
the shape was deleted
Definition KoShape.h:101

References KoShape::Deleted, and m_dependees.

Member Data Documentation

◆ m_dependees

QList<KoShape*>& KoShape::Private::DependeesLifetimeListener::m_dependees
private

Definition at line 88 of file KoShape_p.h.


The documentation for this struct was generated from the following file: