summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-09-17 00:33:34 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-09-17 00:33:34 (GMT)
commit1fae0c607b17f1ed528cac5601c3c8d97a3db658 (patch)
tree44a4ab597e462b76701279feb7db445f6ce52e54 /src/declarative/fx
parent8e0e32458e478d7a6a7a1623d4df768104df4b49 (diff)
downloadQt-1fae0c607b17f1ed528cac5601c3c8d97a3db658.zip
Qt-1fae0c607b17f1ed528cac5601c3c8d97a3db658.tar.gz
Qt-1fae0c607b17f1ed528cac5601c3c8d97a3db658.tar.bz2
Don't crash when you have non-FxItem contents
doesn't actually do anything about non-FxItem contents yet, and maybe it should.
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxitem.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index a2c744e..3eec955 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -262,6 +262,8 @@ void QFxContents::calcHeight()
QList<QGraphicsItem *> children = m_item->childItems();
for (int i = 0; i < children.count(); ++i) {
QFxItem *child = qobject_cast<QFxItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QFxItem graphicsobjects?
+ continue;
qreal y = child->y();
if (y + child->height() > bottom)
bottom = y + child->height();
@@ -288,6 +290,8 @@ void QFxContents::calcWidth()
QList<QGraphicsItem *> children = m_item->childItems();
for (int i = 0; i < children.count(); ++i) {
QFxItem *child = qobject_cast<QFxItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QFxItem graphicsobjects?
+ continue;
qreal x = child->x();
if (x + child->width() > right)
right = x + child->width();
@@ -309,6 +313,8 @@ void QFxContents::setItem(QFxItem *item)
QList<QGraphicsItem *> children = m_item->childItems();
for (int i = 0; i < children.count(); ++i) {
QFxItem *child = qobject_cast<QFxItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QFxItem graphicsobjects?
+ continue;
connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight()));
connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight()));
connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth()));