summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-05-01 18:31:54 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-05-05 05:02:51 +0000
commit3287e7a68a3feff5c34f109b6af0f894a0362801 (patch)
tree462e934f342e135e68833aab3cb4d1e280f6d2e9 /src/widgets
parentf44f2136e07bfea792a7aafd7c2058eac0ba595d (diff)
QGraphicsWidget: call normal "setParent" when setting a parent
QGraphicsWidgetPrivate::init had a special code path for setting the item's parent. For some reason that code path caused the ItemChildAddedChange notification not to be sent to the parent element, which is wrong. Instead use the "normal" path, which is what the QGraphicsItem constructor does anyhow. Change-Id: Iad84cae05d797022a45977d35ca00c80c17c306a Task-number: QTBUG-45867 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp
index 402d54d2d8..e9ab6dffec 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp
@@ -64,9 +64,7 @@ void QGraphicsWidgetPrivate::init(QGraphicsItem *parentItem, Qt::WindowFlags wFl
adjustWindowFlags(&wFlags);
windowFlags = wFlags;
- if (parentItem)
- setParentItemHelper(parentItem, 0, 0);
-
+ q->setParentItem(parentItem);
q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::DefaultType));
q->setGraphicsItem(q);