QQuickCanvas renames
[profile/ivi/qtdeclarative.git] / src / quick / items / qquickdroparea.cpp
index a811d01..1892a43 100644 (file)
@@ -1,10 +1,9 @@
 /****************************************************************************
 **
 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
 ** Contact: http://www.qt-project.org/
 **
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the QtQml module of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
 ** GNU Lesser General Public License Usage
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 #include "qquickdroparea_p.h"
 #include "qquickdrag_p.h"
 #include "qquickitem_p.h"
-#include "qquickcanvas.h"
+#include "qquickwindow.h"
+
+#include <private/qqmlengine_p.h>
 
-#include <private/qdeclarativeengine_p.h>
+#ifndef QT_NO_DRAGANDDROP
 
 QT_BEGIN_NAMESPACE
 
@@ -74,8 +76,8 @@ public:
     QRegExp keyRegExp;
     QPointF dragPosition;
     QQuickDropAreaDrag *drag;
-    QDeclarativeGuard<QObject> source;
-    QDeclarativeGuard<QMimeData> mimeData;
+    QQmlGuard<QObject> source;
+    QQmlGuard<QMimeData> mimeData;
 };
 
 QQuickDropAreaPrivate::QQuickDropAreaPrivate()
@@ -91,7 +93,8 @@ QQuickDropAreaPrivate::~QQuickDropAreaPrivate()
 /*!
     \qmlclass DropArea QQuickDropArea
     \inqmlmodule QtQuick 2
-    \brief The DropArea item provides drag and drop handling.
+    \ingroup qtquick-input
+    \brief For specifying drag and drop handling in an area
 
     A DropArea is an invisible item which receives events when other items are
     dragged over it.
@@ -230,8 +233,9 @@ bool QQuickDropAreaPrivate::hasMatchingKey(const QStringList &keys) const
     if (keyRegExp.isEmpty())
         return true;
 
+    QRegExp copy = keyRegExp;
     foreach (const QString &key, keys) {
-        if (keyRegExp.exactMatch(key))
+        if (copy.exactMatch(key))
             return true;
     }
     return false;
@@ -325,7 +329,8 @@ void QQuickDropArea::dropEvent(QDropEvent *event)
 /*!
     \qmlclass DragEvent QQuickDragEvent
     \inqmlmodule QtQuick 2
-    \brief The DragEvent object provides information about a drag event.
+    \ingroup qtquick-input-events
+    \brief Provides information about a drag event
 
     The position of the drag event can be obtained from the \l x and \l y
     properties, and the \l keys property identifies the drag keys of the event
@@ -371,17 +376,17 @@ QStringList QQuickDropEvent::keys() const
 }
 
 /*!
-    \qmlproperty enum QtQuick2::DragEvent::action
+    \qmlproperty enumeration QtQuick2::DragEvent::action
 
     This property holds the action that the \l source is to perform on an accepted drop.
 
     The drop action may be one of:
 
     \list
-    \o Qt.CopyAction Copy the data to the target
-    \o Qt.MoveAction Move the data from the source to the target
-    \o Qt.LinkAction Create a link from the source to the target.
-    \o Qt.IgnoreAction Ignore the action (do nothing with the data).
+    \li Qt.CopyAction Copy the data to the target
+    \li Qt.MoveAction Move the data from the source to the target
+    \li Qt.LinkAction Create a link from the source to the target.
+    \li Qt.IgnoreAction Ignore the action (do nothing with the data).
     \endlist
 */
 
@@ -402,14 +407,14 @@ QStringList QQuickDropEvent::keys() const
 
 /*!
     \qmlmethod void QtQuick2::DragEvent::accept()
-    \qmlmethod void QtQuick2::DragEvent::accept(enum action)
+    \qmlmethod void QtQuick2::DragEvent::accept(enumeration action)
 
     Accepts the drag event.
 
     If an \a action is specified it will overwrite the value of the \l action property.
 */
 
-void QQuickDropEvent::accept(QDeclarativeV8Function *args)
+void QQuickDropEvent::accept(QQmlV8Function *args)
 {
     Qt::DropAction action = event->dropAction();
 
@@ -426,3 +431,4 @@ void QQuickDropEvent::accept(QDeclarativeV8Function *args)
 
 QT_END_NAMESPACE
 
+#endif // QT_NO_DRAGANDDROP