diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-25 05:51:31 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-25 05:54:54 (GMT) |
commit | 1c9dcb09b79d77bc7d4958e1393437597892bb0b (patch) | |
tree | 3836e4507b7feed6f07b958331fff7c10993cbe9 /src/declarative/graphicsitems/qmlgraphicsanchors.cpp | |
parent | 50ef19f6eca9d433deed3f3c7062901a5d2f292c (diff) | |
download | Qt-1c9dcb09b79d77bc7d4958e1393437597892bb0b.zip Qt-1c9dcb09b79d77bc7d4958e1393437597892bb0b.tar.gz Qt-1c9dcb09b79d77bc7d4958e1393437597892bb0b.tar.bz2 |
Add reset function for anchors.fill and anchors.centerIn.
Task-number: QTBUG-5337
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsanchors.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsanchors.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp index f26fbf5..8642476 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp @@ -355,6 +355,7 @@ void QmlGraphicsAnchors::setFill(QmlGraphicsItem *f) if (!f) { d->remDepend(d->fill); d->fill = f; + emit fillChanged(); return; } if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){ @@ -368,6 +369,11 @@ void QmlGraphicsAnchors::setFill(QmlGraphicsItem *f) d->fillChanged(); } +void QmlGraphicsAnchors::resetFill() +{ + setFill(0); +} + QmlGraphicsItem *QmlGraphicsAnchors::centerIn() const { Q_D(const QmlGraphicsAnchors); @@ -383,6 +389,7 @@ void QmlGraphicsAnchors::setCenterIn(QmlGraphicsItem* c) if (!c) { d->remDepend(d->centerIn); d->centerIn = c; + emit centerInChanged(); return; } if (c != d->item->parentItem() && c->parentItem() != d->item->parentItem()){ @@ -397,6 +404,11 @@ void QmlGraphicsAnchors::setCenterIn(QmlGraphicsItem* c) d->centerInChanged(); } +void QmlGraphicsAnchors::resetCenterIn() +{ + setCenterIn(0); +} + bool QmlGraphicsAnchorsPrivate::calcStretch(const QmlGraphicsAnchorLine &edge1, const QmlGraphicsAnchorLine &edge2, int offset1, |