summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-01 16:06:23 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-01 16:06:23 (GMT)
commitf707672eb4c51ea82fbd98e1da16ece61a74c690 (patch)
treef276d6ae14986b29cf29da411691b57d3dd47a89 /src/gui/graphicsview
parent1c3fa677ee494f8982c99b468b4a4fcad8aa04c7 (diff)
parent14de8cecfa5b5428d597c9cca111ee0f3f89502f (diff)
downloadQt-f707672eb4c51ea82fbd98e1da16ece61a74c690.zip
Qt-f707672eb4c51ea82fbd98e1da16ece61a74c690.tar.gz
Qt-f707672eb4c51ea82fbd98e1da16ece61a74c690.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicstransform.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp
index 06df788..513c41f 100644
--- a/src/gui/graphicsview/qgraphicstransform.cpp
+++ b/src/gui/graphicsview/qgraphicstransform.cpp
@@ -92,6 +92,7 @@
#include "qgraphicstransform_p.h"
#include <QDebug>
#include <QtCore/qmath.h>
+#include <QtCore/qnumeric.h>
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
@@ -467,6 +468,7 @@ void QGraphicsRotation::setOrigin(const QVector3D &point)
item will be rotated counter-clockwise. Normally the rotation angle will be
in the range (-360, 360), but you can also provide numbers outside of this
range (e.g., a angle of 370 degrees gives the same result as 10 degrees).
+ Setting the angle to NaN results in no rotation.
\sa origin
*/
@@ -570,7 +572,7 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const
{
Q_D(const QGraphicsRotation);
- if (d->angle == 0. || d->axis.isNull())
+ if (d->angle == 0. || d->axis.isNull() || qIsNaN(d->angle))
return;
matrix->translate(d->origin);
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 0e2750d..488a36a 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2497,7 +2497,7 @@ QVariant QGraphicsView::inputMethodQuery(Qt::InputMethodQuery query) const
else if (value.type() == QVariant::PointF)
value = mapFromScene(value.toPointF());
else if (value.type() == QVariant::Rect)
- value = mapFromScene(value.toRect()).boundingRect();
+ value = d->mapRectFromScene(value.toRect()).toRect();
else if (value.type() == QVariant::Point)
value = mapFromScene(value.toPoint());
return value;