summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-04-07 16:37:08 +0200
committerJens Bache-Wiig <jbache@trolltech.com>2009-04-07 16:43:15 +0200
commit35c26d696cbff269d551c012a212c09692dd6f6b (patch)
treeb5f9f5c298e1f2d1b0ef6b4986dc03c7822df12d /demos
parent773c4d326c24f8db12ab58e379bd223ce1126d72 (diff)
Bt: Fix regression in the Embedded dialogs example
We had to revert an earlier fix since it obviously did not work correctly. However since we do not really need to propagate the palette on the viewContainer _before_ it is created, we can simply avoid the issue alltogether as it would happen because we implicitly added a child widget during the polish of the combo box. Reviewed-by: nrc
Diffstat (limited to 'demos')
-rw-r--r--demos/embeddeddialogs/customproxy.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp
index 56a0548ba8..ed2fc763f9 100644
--- a/demos/embeddeddialogs/customproxy.cpp
+++ b/demos/embeddeddialogs/customproxy.cpp
@@ -111,8 +111,15 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value)
{
- if (change == ItemChildRemovedChange)
- removeSceneEventFilter(this);
+ if (change == ItemChildAddedChange || change == ItemChildRemovedChange) {
+ QGraphicsItem *item = qVariantValue<QGraphicsItem *>(value);
+ if (change == ItemChildAddedChange) {
+ item->setCacheMode(ItemCoordinateCache);
+ item->installSceneEventFilter(this);
+ } else {
+ item->removeSceneEventFilter(this);
+ }
+ }
return QGraphicsProxyWidget::itemChange(change, value);
}