summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/embeddeddialogs/customproxy.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp
index ed2fc76..56a0548 100644
--- a/demos/embeddeddialogs/customproxy.cpp
+++ b/demos/embeddeddialogs/customproxy.cpp
@@ -111,15 +111,8 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value)
{
- if (change == ItemChildAddedChange || change == ItemChildRemovedChange) {
- QGraphicsItem *item = qVariantValue<QGraphicsItem *>(value);
- if (change == ItemChildAddedChange) {
- item->setCacheMode(ItemCoordinateCache);
- item->installSceneEventFilter(this);
- } else {
- item->removeSceneEventFilter(this);
- }
- }
+ if (change == ItemChildRemovedChange)
+ removeSceneEventFilter(this);
return QGraphicsProxyWidget::itemChange(change, value);
}