qmlobserver: workaround crash if an item has an infinite scale

infinite scale may occours if the qml scale binding sets an infinite scale.
This commit is contained in:
Olivier Goffart
2010-08-25 14:34:47 +02:00
parent 726985303b
commit 6ba643516b

View File

@@ -78,8 +78,11 @@ void SelectionIndicator::clear()
QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPolygonF &polygon)
{
// ### remove this if statement when QTBUG-12172 gets fixed
if (item->boundingRect() != QRectF(0,0,0,0))
polygon = polygon.united(item->mapToScene(item->boundingRect()));
if (item->boundingRect() != QRectF(0,0,0,0)) {
QPolygonF bounding = item->mapToScene(item->boundingRect());
if (bounding.isClosed()) //avoid crashes if there is an infinite scale.
polygon = polygon.united(bounding);
}
foreach(QGraphicsItem *child, item->childItems()) {
if (!QDeclarativeDesignViewPrivate::get(m_view)->isEditorItem(child))