diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-07-20 02:20:21 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-07-26 07:05:35 (GMT) |
commit | 789524c44f0c292b3309bbd000831f25e99c1b32 (patch) | |
tree | 84cd4cb59960c04303c2c0696dfb7400f297c5b5 /src | |
parent | 3f0bae81dc23ecec747907cb5525ed383867801a (diff) | |
download | Qt-789524c44f0c292b3309bbd000831f25e99c1b32.zip Qt-789524c44f0c292b3309bbd000831f25e99c1b32.tar.gz Qt-789524c44f0c292b3309bbd000831f25e99c1b32.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
(cherry picked from commit b2f90dedbeac285338af07fbffaec97ceaf0876f)
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 5 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea.cpp | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 14158c8..f6c395f 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) { } |