summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-30 08:03:30 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-30 08:03:30 (GMT)
commit29cad9b72fb96b3e66bcbbc0d4db28fe26842598 (patch)
tree632dfefbe458f07de8071d1b5f11b0e62135c676 /src/declarative
parent89f21d7269ae7bf29e718958d00da84e5c60257f (diff)
downloadQt-29cad9b72fb96b3e66bcbbc0d4db28fe26842598.zip
Qt-29cad9b72fb96b3e66bcbbc0d4db28fe26842598.tar.gz
Qt-29cad9b72fb96b3e66bcbbc0d4db28fe26842598.tar.bz2
Don't create an anchors element so that we can check that there aren't any
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 3f1d2ac..c1ef04d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -443,12 +443,15 @@ void QDeclarativeColumn::reportConflictingAnchors()
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
if (child.item) {
- QDeclarativeAnchors::Anchors usedAnchors = QDeclarativeItemPrivate::get(child.item)->anchors()->usedAnchors();
- if (usedAnchors & QDeclarativeAnchors::TopAnchor ||
- usedAnchors & QDeclarativeAnchors::BottomAnchor ||
- usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
- childsWithConflictingAnchors = true;
- break;
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::TopAnchor ||
+ usedAnchors & QDeclarativeAnchors::BottomAnchor ||
+ usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ childsWithConflictingAnchors = true;
+ break;
+ }
}
}
}
@@ -578,12 +581,15 @@ void QDeclarativeRow::reportConflictingAnchors()
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
if (child.item) {
- QDeclarativeAnchors::Anchors usedAnchors = QDeclarativeItemPrivate::get(child.item)->anchors()->usedAnchors();
- if (usedAnchors & QDeclarativeAnchors::LeftAnchor ||
- usedAnchors & QDeclarativeAnchors::RightAnchor ||
- usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
- childsWithConflictingAnchors = true;
- break;
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::LeftAnchor ||
+ usedAnchors & QDeclarativeAnchors::RightAnchor ||
+ usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ childsWithConflictingAnchors = true;
+ break;
+ }
}
}
}
@@ -868,9 +874,12 @@ void QDeclarativeGrid::reportConflictingAnchors()
bool childsWithConflictingAnchors(false);
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item && QDeclarativeItemPrivate::get(child.item)->anchors()->usedAnchors()) {
- childsWithConflictingAnchors = true;
- break;
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors && anchors->usedAnchors()) {
+ childsWithConflictingAnchors = true;
+ break;
+ }
}
}
if (childsWithConflictingAnchors) {
@@ -1025,9 +1034,12 @@ void QDeclarativeFlow::reportConflictingAnchors()
bool childsWithConflictingAnchors(false);
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item && QDeclarativeItemPrivate::get(child.item)->anchors()->usedAnchors()) {
- childsWithConflictingAnchors = true;
- break;
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors && anchors->usedAnchors()) {
+ childsWithConflictingAnchors = true;
+ break;
+ }
}
}
if (childsWithConflictingAnchors) {