8#include <private/qv4arraybuffer_p.h>
10#include <QtCore/qpointer.h>
11#include <QtCore/qregularexpression.h>
99 return d->containsDrag;
122 if (
d->keys !=
keys) {
125 if (
keys.isEmpty()) {
129 for (
int i = 1;
i <
keys.size(); ++
i)
186 if (!
d->containsDrag)
189 d->dragPosition =
event->position().toPoint();
191 emit d->drag->positionChanged();
213 return dragMime->keys();
227 if (!
d->effectiveEnable ||
d->containsDrag || !
mimeData || !
d->hasMatchingKey(
d->getKeys(
mimeData)))
231 auto dragSource = dragMime ? dragMime->source() :
event->source();
235 if (
QQuickItem *dragSourceItem = qobject_cast<QQuickItem *>(dragSource)) {
236 if (dragSourceItem->isAncestorOf(
this))
240 d->dragPosition =
event->position().toPoint();
246 if (!
event->isAccepted())
249 d->containsDrag =
true;
250 d->source = dragSource;
251 d->dragPosition =
event->position().toPoint();
253 emit d->drag->positionChanged();
254 emit d->drag->sourceChanged();
268 if (!
d->containsDrag)
273 d->containsDrag =
false;
277 emit d->drag->sourceChanged();
290 if (!
d->containsDrag)
296 d->containsDrag =
false;
300 emit d->drag->sourceChanged();
483 return dragMime->source();
485 return event->source();
495 return event->mimeData()->hasColor();
500 return event->mimeData()->hasHtml();
505 return event->mimeData()->hasText();
510 return event->mimeData()->hasUrls();
515 return event->mimeData()->colorData();
520 return event->mimeData()->html();
525 return event->mimeData()->text();
530 return event->mimeData()->urls();
535 return event->mimeData()->formats();
550 event->acceptProposedAction();
556 event->setDropAction(
action);
563 event->setDropAction(
action);
570#include "moc_qquickdroparea_p.cpp"
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
virtual QStringList formats() const
Returns a list of formats supported by the object.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Q_INVOKABLE void accept()
Q_INVOKABLE QByteArray getDataAsArrayBuffer(const QString &format) const
Q_INVOKABLE QString getDataAsString(const QString &format) const
Q_INVOKABLE void acceptProposedAction()
QQuickDropAreaDrag(QQuickDropAreaPrivate *d, QObject *parent=nullptr)
QQuickDropAreaDrag * drag
QStringList getKeys(const QMimeData *mimeData) const
QPointer< QObject > source
QRegularExpression keyRegExp
bool hasMatchingKey(const QStringList &keys) const
void dragEnterEvent(QDragEnterEvent *event) override
\qmlsignal QtQuick::DropArea::entered(DragEvent drag)
void setKeys(const QStringList &keys)
void dropEvent(QDropEvent *event) override
\qmlsignal QtQuick::DropArea::dropped(DragEvent drop)
void containsDragChanged()
void dropped(QQuickDragEvent *drop)
void dragLeaveEvent(QDragLeaveEvent *event) override
\qmlsignal QtQuick::DropArea::exited()
void entered(QQuickDragEvent *drag)
QQuickDropAreaDrag * drag
void dragMoveEvent(QDragMoveEvent *event) override
\qmlsignal QtQuick::DropArea::positionChanged(DragEvent drag)
QQuickDropArea(QQuickItem *parent=0)
\qmltype DropArea \instantiates QQuickDropArea \inherits Item \inqmlmodule QtQuick
void positionChanged(QQuickDragEvent *drag)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFlags(Flags flags)
Enables the specified flags for this item.
\inmodule QtCore \reentrant
static QString escape(const QString &str)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString pattern() const
Returns the pattern string of the regular expression.
static QString anchoredPattern(const QString &expression)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum format
QLatin1StringView QLatin1String
\inmodule QtCore \reentrant