aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgcanvas_p.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-09-12 14:17:08 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-10 05:48:01 +0200
commitc825865cdd88445aa1db94cdf0da89426919acdb (patch)
tree93418f7a0ab78ddb3b51e59b0a30e30d3c1872b5 /src/declarative/items/qsgcanvas_p.h
parent65bf7aa06a59790d0aea30b909577747510bb5d1 (diff)
Add DropArea item and Drag attached property.
Refactors drag API to improve compatibility with traditional drag and drop by reusing events and adding drop actions. Event sending is removed from MouseArea, instead the Drag object can be attached to the item that is dragged and it will send drag events when the position of that item is changed or when its active property changes. The DragTarget item is renamed to DropArea and can now communicate supported and suggested actions. Task-number: QTBUG-19747 Change-Id: I46cb77e68cf1ff32bbcbf0945facb593c9c2243c Reviewed-on: http://codereview.qt-project.org/4638 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgcanvas_p.h')
-rw-r--r--src/declarative/items/qsgcanvas_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h
index 4a53e6bb1b..e2ec7a1963 100644
--- a/src/declarative/items/qsgcanvas_p.h
+++ b/src/declarative/items/qsgcanvas_p.h
@@ -55,10 +55,10 @@
#include "qsgitem.h"
#include "qsgcanvas.h"
-#include "qsgevent.h"
#include <private/qdeclarativeguard_p.h>
#include <private/qsgcontext_p.h>
+#include <private/qsgdrag_p.h>
#include <QtCore/qthread.h>
#include <QtCore/qmutex.h>
@@ -102,6 +102,7 @@ public:
QSGItem *activeFocusItem;
QSGItem *mouseGrabberItem;
+ QSGDragGrabber dragGrabber;
// Mouse positions are saved in widget coordinates
QPointF lastMousePosition;
@@ -118,8 +119,8 @@ public:
bool sendHoverEvent(QEvent::Type, QSGItem *, const QPointF &scenePos, const QPointF &lastScenePos,
Qt::KeyboardModifiers modifiers, bool accepted);
bool clearHover();
- void deliverDragEvent(QSGDragEvent *);
- bool deliverDragEvent(QSGItem *item, QSGDragEvent *);
+ void deliverDragEvent(QSGDragGrabber *, QEvent *);
+ bool deliverDragEvent(QSGDragGrabber *, QSGItem *, QDragMoveEvent *);
QList<QSGItem*> hoverItems;
enum FocusOption {
@@ -300,7 +301,6 @@ public:
void run();
};
-
Q_DECLARE_OPERATORS_FOR_FLAGS(QSGCanvasPrivate::FocusOptions)
QT_END_NAMESPACE