diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-09 00:33:52 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-09 00:33:52 (GMT) |
commit | 51900441b77df5cb4755aaf2cba8351bbfe15e71 (patch) | |
tree | ea5e2d02ba0b787221ca36571cd13c508a1a4cf6 /src/declarative/graphicsitems/qdeclarativeanchors.cpp | |
parent | ac764b3d0e7b7b591481da5f4da821bc27400817 (diff) | |
download | Qt-51900441b77df5cb4755aaf2cba8351bbfe15e71.zip Qt-51900441b77df5cb4755aaf2cba8351bbfe15e71.tar.gz Qt-51900441b77df5cb4755aaf2cba8351bbfe15e71.tar.bz2 |
Minor anchors.fill optimization.
Task-number: QT-716
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeanchors.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeanchors.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp index 274d778..dc1f09d 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp @@ -168,8 +168,7 @@ void QDeclarativeAnchorsPrivate::fillChanged() } else if (fill->parentItem() == item->parentItem()) { //siblings setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin)); } - setItemWidth(fill->width()-leftMargin-rightMargin); - setItemHeight(fill->height()-topMargin-bottomMargin); + setItemSize(QSizeF(fill->width()-leftMargin-rightMargin, fill->height()-topMargin-bottomMargin)); --updatingFill; } else { @@ -314,6 +313,13 @@ void QDeclarativeAnchorsPrivate::setItemPos(const QPointF &v) updatingMe = false; } +void QDeclarativeAnchorsPrivate::setItemSize(const QSizeF &v) +{ + updatingMe = true; + item->setSize(v); + updatingMe = false; +} + void QDeclarativeAnchorsPrivate::updateMe() { if (updatingMe) { |