aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickdroparea.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-06-13 20:11:22 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-09-30 10:23:19 +0200
commita51dcbb4c77e89a924cbfa592411ed830387aeab (patch)
treef906b5d2f12d4b99c8551470bf775e2db852843e /src/quick/items/qquickdroparea.cpp
parent1a5a092d381fb7e7bc6447704ae9bf5be84c300f (diff)
Make DragEvent a public type again
It is a documented type, and naming signal parameter types allows easier composition of QML types: // MyCustomDropArea.qml Item { id: root signal dropped(event: DragEvent) // with named type // signal dropped(event: QtObject) without we could only use QtObject DropArea { onDropped: (ev) => root.dropped(ev) } } Pick-to: 6.2 Change-Id: I751fec7356b5f1bb58e61e4f8de72c9b8d9d5c60 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/items/qquickdroparea.cpp')
-rw-r--r--src/quick/items/qquickdroparea.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp
index 21dc0979a9..077574cbd1 100644
--- a/src/quick/items/qquickdroparea.cpp
+++ b/src/quick/items/qquickdroparea.cpp
@@ -226,7 +226,7 @@ void QQuickDropArea::dragMoveEvent(QDragMoveEvent *event)
emit d->drag->positionChanged();
event->accept();
- QQuickDropEvent dragTargetEvent(d, event);
+ QQuickDragEvent dragTargetEvent(d, event);
emit positionChanged(&dragTargetEvent);
}
@@ -276,7 +276,7 @@ void QQuickDropArea::dragEnterEvent(QDragEnterEvent *event)
event->accept();
- QQuickDropEvent dragTargetEvent(d, event);
+ QQuickDragEvent dragTargetEvent(d, event);
emit entered(&dragTargetEvent);
if (!event->isAccepted())
return;
@@ -325,7 +325,7 @@ void QQuickDropArea::dropEvent(QDropEvent *event)
if (!d->containsDrag)
return;
- QQuickDropEvent dragTargetEvent(d, event);
+ QQuickDragEvent dragTargetEvent(d, event);
emit dropped(&dragTargetEvent);
d->containsDrag = false;
@@ -337,7 +337,7 @@ void QQuickDropArea::dropEvent(QDropEvent *event)
/*!
\qmltype DragEvent
- \instantiates QQuickDropEvent
+ \instantiates QQuickDragEvent
\inqmlmodule QtQuick
\ingroup qtquick-input-events
\brief Provides information about a drag event.
@@ -514,7 +514,7 @@ void QQuickDropArea::dropEvent(QDropEvent *event)
easily be translated into a QByteArray. \a format should be one contained in the \l formats property.
*/
-QObject *QQuickDropEvent::source() const
+QObject *QQuickDragEvent::source() const
{
if (const QQuickDragMimeData *dragMime = qobject_cast<const QQuickDragMimeData *>(event->mimeData()))
return dragMime->source();
@@ -522,57 +522,57 @@ QObject *QQuickDropEvent::source() const
return event->source();
}
-QStringList QQuickDropEvent::keys() const
+QStringList QQuickDragEvent::keys() const
{
return d->getKeys(event->mimeData());
}
-bool QQuickDropEvent::hasColor() const
+bool QQuickDragEvent::hasColor() const
{
return event->mimeData()->hasColor();
}
-bool QQuickDropEvent::hasHtml() const
+bool QQuickDragEvent::hasHtml() const
{
return event->mimeData()->hasHtml();
}
-bool QQuickDropEvent::hasText() const
+bool QQuickDragEvent::hasText() const
{
return event->mimeData()->hasText();
}
-bool QQuickDropEvent::hasUrls() const
+bool QQuickDragEvent::hasUrls() const
{
return event->mimeData()->hasUrls();
}
-QVariant QQuickDropEvent::colorData() const
+QVariant QQuickDragEvent::colorData() const
{
return event->mimeData()->colorData();
}
-QString QQuickDropEvent::html() const
+QString QQuickDragEvent::html() const
{
return event->mimeData()->html();
}
-QString QQuickDropEvent::text() const
+QString QQuickDragEvent::text() const
{
return event->mimeData()->text();
}
-QList<QUrl> QQuickDropEvent::urls() const
+QList<QUrl> QQuickDragEvent::urls() const
{
return event->mimeData()->urls();
}
-QStringList QQuickDropEvent::formats() const
+QStringList QQuickDragEvent::formats() const
{
return event->mimeData()->formats();
}
-void QQuickDropEvent::getDataAsString(QQmlV4Function *args)
+void QQuickDragEvent::getDataAsString(QQmlV4Function *args)
{
if (args->length() != 0) {
QV4::ExecutionEngine *v4 = args->v4engine();
@@ -584,7 +584,7 @@ void QQuickDropEvent::getDataAsString(QQmlV4Function *args)
}
}
-void QQuickDropEvent::getDataAsArrayBuffer(QQmlV4Function *args)
+void QQuickDragEvent::getDataAsArrayBuffer(QQmlV4Function *args)
{
if (args->length() != 0) {
QV4::ExecutionEngine *v4 = args->v4engine();
@@ -595,12 +595,12 @@ void QQuickDropEvent::getDataAsArrayBuffer(QQmlV4Function *args)
}
}
-void QQuickDropEvent::acceptProposedAction(QQmlV4Function *)
+void QQuickDragEvent::acceptProposedAction(QQmlV4Function *)
{
event->acceptProposedAction();
}
-void QQuickDropEvent::accept(QQmlV4Function *args)
+void QQuickDragEvent::accept(QQmlV4Function *args)
{
Qt::DropAction action = event->dropAction();