summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-07-20 02:20:21 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-07-20 02:24:17 (GMT)
commitb2f90dedbeac285338af07fbffaec97ceaf0876f (patch)
treeca7cb75a8c5f82b9e5877ba677f0e40de406a649 /src
parent5b39b47255d04675f15b242252565ec0b7e8e78e (diff)
downloadQt-b2f90dedbeac285338af07fbffaec97ceaf0876f.zip
Qt-b2f90dedbeac285338af07fbffaec97ceaf0876f.tar.gz
Qt-b2f90dedbeac285338af07fbffaec97ceaf0876f.tar.bz2
Better defaults for MouseArea's drag.
Allow essentially unbounded dragging once drag.target is set. The previous default of contraining the dragging to 0,0 (i.e. no drag) was unintuitive for learners. It's rare that unbounded is actually what you want, but it makes it much easier to get started with the element. Task-number: QTBUG-11184 Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9d70beb..86ef0df 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -59,16 +59,13 @@
#include <QEvent>
#include <QGraphicsSceneMouseEvent>
#include <QtCore/qnumeric.h>
+#include <QtCore/qmath.h>
#include <QtScript/qscriptengine.h>
#include <QtGui/qgraphicstransform.h>
#include <qlistmodelinterface_p.h>
QT_BEGIN_NAMESPACE
-#ifndef FLT_MAX
-#define FLT_MAX 1E+37
-#endif
-
/*!
\qmlclass Transform QGraphicsTransform
\since 4.7
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index b7b0c9e..7e4a36f 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -45,12 +45,13 @@
#include "private/qdeclarativeevents_p_p.h"
#include <QGraphicsSceneMouseEvent>
+#include <QtCore/qmath.h>
QT_BEGIN_NAMESPACE
static const int PressAndHoldDelay = 800;
QDeclarativeDrag::QDeclarativeDrag(QObject *parent)
-: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0),
+: QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX),
_active(false)
{
}