From b2f90dedbeac285338af07fbffaec97ceaf0876f Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 20 Jul 2010 12:20:21 +1000 Subject: 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 --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 5 +---- 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 9d70beb..86ef0df 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -59,16 +59,13 @@ #include #include #include +#include #include #include #include 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 +#include 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) { } -- cgit v0.12