From 1fae0c607b17f1ed528cac5601c3c8d97a3db658 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 17 Sep 2009 10:33:34 +1000 Subject: Don't crash when you have non-FxItem contents doesn't actually do anything about non-FxItem contents yet, and maybe it should. --- src/declarative/fx/qfxitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast(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 children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast(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 children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QFxItem *child = qobject_cast(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())); -- cgit v0.12