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 936 of file KoShape.h.

Constructor & Destructor Documentation

◆ ~ShapeChangeListener()

KoShape::ShapeChangeListener::~ShapeChangeListener ( )
virtual

Definition at line 1125 of file KoShape.cpp.

1126{
1127 Q_FOREACH(KoShape *shape, m_registeredShapes) {
1128 shape->removeShapeChangeListener(this);
1129 }
1130}
void removeShapeChangeListener(ShapeChangeListener *listener)
Definition KoShape.cpp:1163
QList< KoShape * > m_registeredShapes
Definition KoShape.h:946

References m_registeredShapes, and KoShape::removeShapeChangeListener().

Member Function Documentation

◆ notifyShapeChanged()

◆ notifyShapeChangedImpl()

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

Definition at line 1144 of file KoShape.cpp.

1145{
1147
1148 notifyShapeChanged(type, shape);
1149
1150 if (type == KoShape::Deleted) {
1151 unregisterShape(shape);
1152 }
1153}
@ 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:1138

References KoShape::Deleted, and KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ registerShape()

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

Definition at line 1132 of file KoShape.cpp.

1133{
1135 m_registeredShapes.append(shape);
1136}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ unregisterShape()

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

Definition at line 1138 of file KoShape.cpp.

1139{
1141 m_registeredShapes.removeAll(shape);
1142}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

Friends And Related Symbol Documentation

◆ KoShape

friend class KoShape
friend

Definition at line 941 of file KoShape.h.

Member Data Documentation

◆ m_registeredShapes

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

Definition at line 946 of file KoShape.h.


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