Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShape::ShapeChangeListener Struct Referenceabstract

#include <KoShape.h>

+ Inheritance diagram for KoShape::ShapeChangeListener:

Public Member Functions

virtual void notifyShapeChanged (ChangeType type, KoShape *shape)=0
 
virtual ~ShapeChangeListener ()
 

Private Member Functions

void notifyShapeChangedImpl (ChangeType type, KoShape *shape)
 
void registerShape (KoShape *shape)
 
void unregisterShape (KoShape *shape)
 

Private Attributes

QList< KoShape * > m_registeredShapes
 

Friends

class KoShape
 

Detailed Description

Definition at line 935 of file KoShape.h.

Constructor & Destructor Documentation

◆ ~ShapeChangeListener()

KoShape::ShapeChangeListener::~ShapeChangeListener ( )
virtual

Definition at line 1127 of file KoShape.cpp.

1128{
1129 Q_FOREACH(KoShape *shape, m_registeredShapes) {
1130 shape->removeShapeChangeListener(this);
1131 }
1132}
void removeShapeChangeListener(ShapeChangeListener *listener)
Definition KoShape.cpp:1165
QList< KoShape * > m_registeredShapes
Definition KoShape.h:945

References m_registeredShapes, and KoShape::removeShapeChangeListener().

Member Function Documentation

◆ notifyShapeChanged()

◆ notifyShapeChangedImpl()

void KoShape::ShapeChangeListener::notifyShapeChangedImpl ( KoShape::ChangeType type,
KoShape * shape )
private

Definition at line 1146 of file KoShape.cpp.

1147{
1149
1150 notifyShapeChanged(type, shape);
1151
1152 if (type == KoShape::Deleted) {
1153 unregisterShape(shape);
1154 }
1155}
@ Deleted
the shape was deleted
Definition KoShape.h:101
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
virtual void notifyShapeChanged(ChangeType type, KoShape *shape)=0
void unregisterShape(KoShape *shape)
Definition KoShape.cpp:1140

References KoShape::Deleted, and KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ registerShape()

void KoShape::ShapeChangeListener::registerShape ( KoShape * shape)
private

Definition at line 1134 of file KoShape.cpp.

1135{
1137 m_registeredShapes.append(shape);
1138}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ unregisterShape()

void KoShape::ShapeChangeListener::unregisterShape ( KoShape * shape)
private

Definition at line 1140 of file KoShape.cpp.

1141{
1143 m_registeredShapes.removeAll(shape);
1144}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

Friends And Related Symbol Documentation

◆ KoShape

friend class KoShape
friend

Definition at line 940 of file KoShape.h.

Member Data Documentation

◆ m_registeredShapes

QList<KoShape*> KoShape::ShapeChangeListener::m_registeredShapes
private

Definition at line 945 of file KoShape.h.


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