summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@nokia.com>2010-02-01 17:38:35 (GMT)
committerMarco Bubke <marco.bubke@nokia.com>2010-02-01 18:33:09 (GMT)
commit652be80c25f61aa4fbf28d75ba9971fc709f29c9 (patch)
tree835afbb38bc2a17b2b7fa28a3c34b8b58d9b1369 /src/declarative
parentd28d9c1d6e2c54cf41a9cc52f41b0542cb9717aa (diff)
downloadQt-652be80c25f61aa4fbf28d75ba9971fc709f29c9.zip
Qt-652be80c25f61aa4fbf28d75ba9971fc709f29c9.tar.gz
Qt-652be80c25f61aa4fbf28d75ba9971fc709f29c9.tar.bz2
Tests for NaN values in the property x, y, widht and height setters of
QGraphicsItem and QmlGraphicsItem Task-number: BAUHAUS-268 Reviewed-by: Thomas Hartmann
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index 2f0c555..6835427 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -62,6 +62,8 @@
#include <QtGui/qgraphicseffect.h>
#include <qlistmodelinterface_p.h>
+#include <math.h>
+
QT_BEGIN_NAMESPACE
#ifndef FLT_MAX
@@ -2843,6 +2845,9 @@ qreal QmlGraphicsItem::width() const
void QmlGraphicsItem::setWidth(qreal w)
{
Q_D(QmlGraphicsItem);
+ if (isnan(w))
+ return;
+
d->widthValid = true;
if (d->width == w)
return;
@@ -2912,6 +2917,9 @@ qreal QmlGraphicsItem::height() const
void QmlGraphicsItem::setHeight(qreal h)
{
Q_D(QmlGraphicsItem);
+ if (isnan(h))
+ return;
+
d->heightValid = true;
if (d->height == h)
return;