summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeitem.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 59dd43d..9d6b2a0 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2855,6 +2855,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