Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3821

Clean up the calling of virtual functions from the constructor of QGraphicsWidget(QGraphicsWidget *parent)

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            monsen Marius Bugge Monsen
            smd Jan Arve
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes