diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeitem.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 066bb55..c7d7a4c 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -2865,6 +2865,27 @@ bool QDeclarativeItem::heightValid() const return d->heightValid; } +/*! \internal */ +void QDeclarativeItem::setSize(const QSizeF &size) +{ + Q_D(QDeclarativeItem); + d->heightValid = true; + d->widthValid = true; + + if (d->height == size.height() && d->width == size.width()) + return; + + qreal oldHeight = d->height; + qreal oldWidth = d->width; + + prepareGeometryChange(); + d->height = size.height(); + d->width = size.width(); + + geometryChanged(QRectF(x(), y(), width(), height()), + QRectF(x(), y(), oldWidth, oldHeight)); +} + /*! \qmlproperty bool Item::wantsFocus |