Details
-
Task
-
Resolution: Invalid
-
P2: Important
-
None
-
None
Description
If a subclass of QGraphicsWidget calls QGraphicsWidget(parent) in its constructor, it will not call the proper virtual functions. This should probably be fixed by re-scheduling those virtual calls when the QGraphicsWidget receives the PolishEvent.
Most of this is because in QGraphicsWidgetPrivate::init() we call q->setParentItem(parentItem), which can call these virtual functions:
- QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &value)
- bool QGraphicsWidget::event(QEvent *event)
- void QGraphicsWidget::changeEvent(QEvent *event)
- void QGraphicsWidget::setGeometry(const QRectF &rect)
Fix 22d472c17167c4ca8df5678842768ab63b7baadd fixes this for updateGeometry() and sizeHint(), but we should really handle all cases.