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 1122 of file KoShape.cpp.

1123{
1124 Q_FOREACH(KoShape *shape, m_registeredShapes) {
1125 shape->removeShapeChangeListener(this);
1126 }
1127}
void removeShapeChangeListener(ShapeChangeListener *listener)
Definition KoShape.cpp:1160
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 1141 of file KoShape.cpp.

1142{
1144
1145 notifyShapeChanged(type, shape);
1146
1147 if (type == KoShape::Deleted) {
1148 unregisterShape(shape);
1149 }
1150}
@ 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:1135

References KoShape::Deleted, and KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ registerShape()

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

Definition at line 1129 of file KoShape.cpp.

1130{
1132 m_registeredShapes.append(shape);
1133}

References KIS_SAFE_ASSERT_RECOVER_RETURN.

◆ unregisterShape()

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

Definition at line 1135 of file KoShape.cpp.

1136{
1138 m_registeredShapes.removeAll(shape);
1139}

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: