diff options
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b4e19d1..b7d3c0d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -668,6 +668,7 @@ #include <QtCore/qtimer.h> #include <QtCore/qvariant.h> #include <QtCore/qvarlengtharray.h> +#include <QtCore/qnumeric.h> #include <QtGui/qapplication.h> #include <QtGui/qbitmap.h> #include <QtGui/qpainter.h> @@ -3441,6 +3442,9 @@ void QGraphicsItem::setX(qreal x) if (d_ptr->inDestructor) return; + if (qIsNaN(x)) + return; + d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y())); } @@ -3465,6 +3469,9 @@ void QGraphicsItem::setY(qreal y) if (d_ptr->inDestructor) return; + if (qIsNaN(y)) + return; + d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y)); } |