src/gui/graphicsview/qgraphicswidget.cpp
changeset 37 758a864f9613
parent 30 5dc02b23752f
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   383         event.setNewPos(pos());
   383         event.setNewPos(pos());
   384         QApplication::sendEvent(this, &event);
   384         QApplication::sendEvent(this, &event);
   385         if (wd->inSetPos) {
   385         if (wd->inSetPos) {
   386             //set the new pos
   386             //set the new pos
   387             d->geom.moveTopLeft(pos());
   387             d->geom.moveTopLeft(pos());
       
   388             emit geometryChanged();
   388             return;
   389             return;
   389         }
   390         }
   390     }
   391     }
   391     QSizeF oldSize = size();
   392     QSizeF oldSize = size();
   392     QGraphicsLayoutItem::setGeometry(newGeom);
   393     QGraphicsLayoutItem::setGeometry(newGeom);
   393     emit geometryChanged();
       
   394     // Send resize event
   394     // Send resize event
   395     bool resized = newGeom.size() != oldSize;
   395     bool resized = newGeom.size() != oldSize;
   396     if (resized) {
   396     if (resized) {
   397         QGraphicsSceneResizeEvent re;
   397         QGraphicsSceneResizeEvent re;
   398         re.setOldSize(oldSize);
   398         re.setOldSize(oldSize);
   401             emit widthChanged();
   401             emit widthChanged();
   402         if (oldSize.height() != newGeom.size().height())
   402         if (oldSize.height() != newGeom.size().height())
   403             emit heightChanged();
   403             emit heightChanged();
   404         QApplication::sendEvent(this, &re);
   404         QApplication::sendEvent(this, &re);
   405     }
   405     }
       
   406     emit geometryChanged();
   406 }
   407 }
   407 
   408 
   408 /*!
   409 /*!
   409     \fn QRectF QGraphicsWidget::rect() const
   410     \fn QRectF QGraphicsWidget::rect() const
   410 
   411 
   934     \sa QApplication::font(), QGraphicsScene::font, QFont::resolve()
   935     \sa QApplication::font(), QGraphicsScene::font, QFont::resolve()
   935 */
   936 */
   936 QFont QGraphicsWidget::font() const
   937 QFont QGraphicsWidget::font() const
   937 {
   938 {
   938     Q_D(const QGraphicsWidget);
   939     Q_D(const QGraphicsWidget);
   939     return d->font;
   940     QFont fnt = d->font;
       
   941     fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask);
       
   942     return fnt;
   940 }
   943 }
   941 void QGraphicsWidget::setFont(const QFont &font)
   944 void QGraphicsWidget::setFont(const QFont &font)
   942 {
   945 {
   943     Q_D(QGraphicsWidget);
   946     Q_D(QGraphicsWidget);
   944     setAttribute(Qt::WA_SetFont, font.resolve() != 0);
   947     setAttribute(Qt::WA_SetFont, font.resolve() != 0);