From edcd3846c31ae0798ab14cfd789ffbf75c6a1c46 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 27 Apr 2009 13:40:59 +0000 Subject: [PATCH] New signal, in Scene_item, that will be emitted just before an item is destroyed by the scene. --- Polyhedron/demo/Polyhedron/Scene_item.cpp | 5 +++++ Polyhedron/demo/Polyhedron/Scene_item.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index cd1e4157e41..8e8e7b2a9ad 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -4,6 +4,11 @@ const QColor Scene_item::defaultColor = QColor(100, 100, 255); Scene_item::~Scene_item() {} +void Scene_item::itemAboutToBeDestroyed(Scene_item* item) { + if(this == item) + emit aboutToBeDestroyed(); +} + // Rendering mode as a human readable string QString Scene_item::renderingModeName() const { diff --git a/Polyhedron/demo/Polyhedron/Scene_item.h b/Polyhedron/demo/Polyhedron/Scene_item.h index a294e8edaa5..ac2b64f2192 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_item.h @@ -76,6 +76,11 @@ public slots: rendering_mode = m; } + virtual void itemAboutToBeDestroyed(Scene_item*); + +signals: + void aboutToBeDestroyed(); + protected: // The four basic properties QString name_;