Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickdrag.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickdrag_p.h"
5#include "qquickdrag_p_p.h"
6
7#include <private/qguiapplication_p.h>
8#include <qpa/qplatformintegration.h>
9#include <private/qquickitem_p.h>
10#include <QtQuick/private/qquickevents_p_p.h>
11#include <private/qquickitemchangelistener_p.h>
12#include <private/qquickpixmap_p.h>
13#include <private/qv4scopedvalue_p.h>
14#include <QtCore/qbuffer.h>
15#include <QtCore/qmimedata.h>
16#include <QtCore/qstringconverter.h>
17#include <QtQml/qqmlinfo.h>
18#include <QtGui/qevent.h>
19#include <QtGui/qstylehints.h>
20#include <QtGui/qguiapplication.h>
21#include <QtGui/qimagewriter.h>
22
23#include <qpa/qplatformdrag.h>
24#include <QtGui/qdrag.h>
25
27
28using namespace Qt::StringLiterals;
29
30
62 const QRectF &)
63{
64 if (!change.positionChange() || !active || itemMoved)
65 return;
67}
68
70{
71 if (!active || dragRestarted)
72 return;
73
74 QQuickWindow *newWindow = attachedItem->window();
75
76 if (window != newWindow)
78 else if (window)
80}
81
91
101
103{
104 dragRestarted = false;
105 itemMoved = false;
106
108
109 mimeData->m_source = source;
110 if (!overrideActions)
111 mimeData->m_supportedActions = supportedActions;
112 mimeData->m_keys = keys;
113
114 if (window) {
116 QDragEnterEvent event(scenePos, mimeData->m_supportedActions, mimeData, Qt::NoButton, Qt::NoModifier);
119 }
120}
121
123{
125
126 itemMoved = false;
127 if (window) {
129 QDragMoveEvent event(scenePos, mimeData->m_supportedActions, mimeData, Qt::NoButton, Qt::NoModifier);
132 if (target != dragGrabber.target()) {
134 emit q->targetChanged();
135 }
136 }
137}
138
140{
141 if (window) {
142 QDragLeaveEvent event;
144 window = nullptr;
145 }
146}
147
149{
151 inEvent = true;
152 QQuickWindowPrivate::get(window)->deliveryAgentPrivate()->deliverDragEvent(&dragGrabber, event);
153 inEvent = false;
154}
155
157{
159
160 if (event->type() == QEvent::User) {
161 d->eventQueued = false;
162 if (d->dragRestarted) {
163 d->deliverLeaveEvent();
164 if (!d->mimeData)
165 d->mimeData = new QQuickDragMimeData;
166 d->deliverEnterEvent();
167
168 if (d->target != d->dragGrabber.target()) {
169 d->target = d->dragGrabber.target();
171 }
172 } else if (d->itemMoved) {
173 d->deliverMoveEvent();
174 }
175 return true;
176 } else {
177 return QObject::event(event);
178 }
179}
180
182 : QObject(*new QQuickDragAttachedPrivate, parent)
183{
185 d->attachedItem = qobject_cast<QQuickItem *>(parent);
186 d->source = d->attachedItem;
187}
188
190{
192 delete d->mimeData;
193}
194
212{
213 Q_D(const QQuickDragAttached);
214 return d->active;
215}
216
218{
220 if (d->active != active) {
221 if (d->inEvent)
222 qmlWarning(this) << "active cannot be changed from within a drag event handler";
223 else if (active) {
224 if (d->dragType == QQuickDrag::Internal) {
225 d->start(d->supportedActions);
226 } else {
227 d->active = true;
229 if (d->dragType == QQuickDrag::Automatic) {
230 // There are different semantics than start() since startDrag()
231 // may be called after an internal drag is already started.
232 d->startDrag(d->supportedActions);
233 }
234 }
235 }
236 else
237 cancel();
238 }
239}
240
253{
254 Q_D(const QQuickDragAttached);
255 return d->source;
256}
257
259{
261 if (d->source != item) {
262 d->source = item;
263 if (d->active)
264 d->restartDrag();
266 }
267}
268
270{
272 if (d->source != d->attachedItem) {
273 d->source = d->attachedItem;
274 if (d->active)
275 d->restartDrag();
277 }
278}
279
293{
294 Q_D(const QQuickDragAttached);
295 return d->target;
296}
297
309{
310 Q_D(const QQuickDragAttached);
311 return d->hotSpot;
312}
313
315{
317 if (d->hotSpot != hotSpot) {
318 d->hotSpot = hotSpot;
319
320 if (d->active)
321 d->updatePosition();
322
324 }
325}
326
343{
344 Q_D(const QQuickDragAttached);
345 return d->imageSource;
346}
347
349{
351 if (d->imageSource != url) {
352 d->imageSource = url;
353
354 if (url.isEmpty()) {
355 d->pixmapLoader.clear();
356 } else {
357 d->loadPixmap();
358 }
359
361 }
362}
363
385{
386 Q_D(const QQuickDragAttached);
387 int width = d->imageSourceSize.width();
388 int height = d->imageSourceSize.height();
389 return QSize(width != -1 ? width : d->pixmapLoader.width(),
390 height != -1 ? height : d->pixmapLoader.height());
391}
392
394{
396 if (d->imageSourceSize != size) {
397 d->imageSourceSize = size;
398
399 if (!d->imageSource.isEmpty())
400 d->loadPixmap();
401
403 }
404}
405
416{
417 Q_D(const QQuickDragAttached);
418 return d->keys;
419}
420
422{
424 if (d->keys != keys) {
425 d->keys = keys;
426 if (d->active)
427 d->restartDrag();
429 }
430}
431
443{
444 Q_D(const QQuickDragAttached);
445 return d->externalMimeData;
446}
447
449{
451 if (d->externalMimeData != mimeData) {
452 d->externalMimeData = mimeData;
454 }
455}
456
467{
468 Q_D(const QQuickDragAttached);
469 return d->supportedActions;
470}
471
472void QQuickDragAttached::setSupportedActions(Qt::DropActions actions)
473{
475 if (d->supportedActions != actions) {
476 d->supportedActions = actions;
477 if (d->active)
478 d->restartDrag();
480 }
481}
482
493{
494 Q_D(const QQuickDragAttached);
495 return d->proposedAction;
496}
497
499{
501 if (d->proposedAction != action) {
502 d->proposedAction = action;
503 // The proposed action shouldn't affect whether a drag is accepted
504 // so leave/enter events are excessive, but the target should still
505 // updated.
506 if (d->active)
507 d->updatePosition();
509 }
510}
511
531{
532 Q_D(const QQuickDragAttached);
533 return d->dragType;
534}
535
537{
539 if (d->dragType != dragType) {
540 d->dragType = dragType;
542 }
543}
544
545void QQuickDragAttachedPrivate::start(Qt::DropActions supportedActions)
546{
549
550 if (!mimeData)
552 if (!listening) {
553 QQuickItemPrivate::get(attachedItem)->addItemChangeListener(
555 listening = true;
556 }
557
558 mimeData->m_supportedActions = supportedActions;
559 active = true;
560 itemMoved = false;
561 dragRestarted = false;
562
564
565 if (target != dragGrabber.target()) {
567 emit q->targetChanged();
568 }
569
570 emit q->activeChanged();
571}
572
584{
586 if (d->inEvent) {
587 qmlWarning(this) << "start() cannot be called from within a drag event handler";
588 return;
589 }
590
591 if (d->active)
592 cancel();
593
594 d->overrideActions = false;
595 Qt::DropActions supportedActions = d->supportedActions;
596 // check arguments for supportedActions, maybe data?
597 if (args->length() >= 1) {
598 QV4::Scope scope(args->v4engine());
599 QV4::ScopedValue v(scope, (*args)[0]);
600 if (v->isInt32()) {
601 supportedActions = Qt::DropActions(v->integerValue());
602 d->overrideActions = true;
603 }
604 }
605
606 d->start(supportedActions);
607}
608
626{
628 Qt::DropAction acceptedAction = Qt::IgnoreAction;
629
630 if (d->inEvent) {
631 qmlWarning(this) << "drop() cannot be called from within a drag event handler";
632 return acceptedAction;
633 }
634
635 if (d->itemMoved)
636 d->deliverMoveEvent();
637
638 if (!d->active)
639 return acceptedAction;
640 d->active = false;
641
642 QObject *target = nullptr;
643
644 if (d->window) {
645 QPoint scenePos = d->attachedItem->mapToScene(d->hotSpot).toPoint();
646
647 QDropEvent event(
648 scenePos, d->mimeData->m_supportedActions, d->mimeData, Qt::NoButton, Qt::NoModifier);
650 d->deliverEvent(d->window, &event);
651
652 if (event.isAccepted()) {
653 acceptedAction = event.dropAction();
654 target = d->dragGrabber.target();
655 }
656 }
657
658 if (d->target != target) {
659 d->target = target;
661 }
662
664 return acceptedAction;
665}
666
674{
676
677 if (d->inEvent) {
678 qmlWarning(this) << "cancel() cannot be called from within a drag event handler";
679 return;
680 }
681
682 if (!d->active)
683 return;
684 d->active = false;
685 d->deliverLeaveEvent();
686
687 if (d->target) {
688 d->target = nullptr;
690 }
691
693}
694
714{
715 Q_Q(const QQuickDragAttached);
717
718 for (const auto [mimeType, value] : externalMimeData.asKeyValueRange()) {
719 switch (value.typeId()) {
720 case QMetaType::QByteArray:
721 // byte array assumed to already be correctly encoded
722 mimeData->setData(mimeType, value.toByteArray());
723 break;
724 case QMetaType::QString: {
725 const QString text = value.toString();
726 if (mimeType == u"text/plain"_s) {
728 } else if (mimeType == u"text/html"_s) {
730 } else if (mimeType == u"text/uri-list"_s) {
731 const QUrl url(text);
732 if (url.isValid())
733 mimeData->setUrls({url});
734 else
735 qmlWarning(q) << text << " is not a valid URI";
736 } else if (mimeType.startsWith(u"text/"_s)) {
737 if (qsizetype charsetIdx = mimeType.lastIndexOf(u";charset="_s); charsetIdx != -1) {
738 charsetIdx += sizeof(";charset=") - 1;
739 const QByteArray encoding = mimeType.mid(charsetIdx).toUtf8();
740 QStringEncoder encoder(encoding);
741 if (encoder.isValid())
742 mimeData->setData(mimeType, encoder.encode(text));
743 else
744 qmlWarning(q) << "Don't know how to encode text as " << mimeType;
745 } else {
747 }
748 } else {
750 }
751 break;
752 }
753 case QMetaType::QVariantList:
754 case QMetaType::QStringList:
755 if (mimeType == u"text/uri-list"_s) {
757 QList<QUrl> urls;
758 urls.reserve(values.size());
759 bool error = false;
760 for (qsizetype index = 0; index < values.size(); ++index) {
761 const QUrl url = values.at(index).value<QUrl>();
762 if (url.isValid()) {
763 urls += url;
764 } else {
765 error = true;
766 qmlWarning(q) << "Value '" << values.at(index) << "' at index " << index
767 << " is not a valid URI";
768 }
769 }
770 if (!error)
771 mimeData->setUrls(urls);
772 }
773 break;
774 case QMetaType::QImage:
775 if (const QByteArray mimeTypeUtf8 = mimeType.toUtf8();
776 QImageWriter::supportedMimeTypes().contains(mimeTypeUtf8)) {
777 const auto imageFormats = QImageWriter::imageFormatsForMimeType(mimeTypeUtf8);
778 if (imageFormats.isEmpty()) { // shouldn't happen, but we can fall back
780 break;
781 }
782 const QImage image = value.value<QImage>();
783 QByteArray bytes;
784 {
785 QBuffer buffer(&bytes);
786 QImageWriter encoder(&buffer, imageFormats.first());
787 encoder.write(image);
788 }
789 mimeData->setData(mimeType, bytes);
790 break;
791 }
793 default:
794 qmlWarning(q) << "Don't know how to encode variant of type " << value.metaType()
795 << " as mime type " << mimeType;
796 // compatibility with pre-6.5 - probably a bad idea
797 mimeData->setData(mimeType, value.toString().toUtf8());
798 break;
799 }
800 }
801
802 return mimeData;
803}
804
806{
808
809 QUrl loadUrl = imageSource;
810 const QQmlContext *context = qmlContext(q->parent());
811 if (context)
812 loadUrl = context->resolvedUrl(imageSource);
813 pixmapLoader.load(context ? context->engine() : nullptr, loadUrl, QRect(), q->imageSourceSize());
814}
815
817{
819
820 QDrag *drag = new QDrag(source ? source : q);
821
823 if (pixmapLoader.isReady())
825
826 drag->setHotSpot(hotSpot.toPoint());
827 emit q->dragStarted();
828
829 Qt::DropAction dropAction = drag->exec(supportedActions);
830
831 if (!QGuiApplicationPrivate::platformIntegration()->drag()->ownsDragObject())
832 drag->deleteLater();
833
835
836 if (target) {
837 target = nullptr;
838 emit q->targetChanged();
839 }
840
841 emit q->dragFinished(dropAction);
842
843 active = false;
844 emit q->activeChanged();
845
846 return dropAction;
847}
848
849
860{
862
863 if (d->inEvent) {
864 qmlWarning(this) << "startDrag() cannot be called from within a drag event handler";
865 return;
866 }
867
868 if (!d->active) {
869 qmlWarning(this) << "startDrag() drag must be active";
870 return;
871 }
872
873 Qt::DropActions supportedActions = d->supportedActions;
874
875 // check arguments for supportedActions
876 if (args->length() >= 1) {
877 QV4::Scope scope(args->v4engine());
878 QV4::ScopedValue v(scope, (*args)[0]);
879 if (v->isInt32()) {
880 supportedActions = Qt::DropActions(v->integerValue());
881 }
882 }
883
884 Qt::DropAction dropAction = d->startDrag(supportedActions);
885
886 args->setReturnValue(QV4::Encode((int)dropAction));
887}
888
890: QObject(parent), _target(nullptr), _axis(XAndYAxis), _xmin(-FLT_MAX),
891_xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX), _active(false), _filterChildren(false),
892 _smoothed(true), _threshold(QGuiApplication::styleHints()->startDragDistance())
893{
894}
895
899
901{
902 return _target;
903}
904
906{
907 if (_target == t)
908 return;
909 _target = t;
911}
912
914{
915 if (_target == nullptr)
916 return;
917 _target = nullptr;
919}
920
922{
923 return _axis;
924}
925
927{
928 if (_axis == a)
929 return;
930 _axis = a;
932}
933
935{
936 return _xmin;
937}
938
940{
941 if (_xmin == m)
942 return;
943 _xmin = m;
945}
946
948{
949 return _xmax;
950}
951
953{
954 if (_xmax == m)
955 return;
956 _xmax = m;
958}
959
961{
962 return _ymin;
963}
964
966{
967 if (_ymin == m)
968 return;
969 _ymin = m;
971}
972
974{
975 return _ymax;
976}
977
979{
980 if (_ymax == m)
981 return;
982 _ymax = m;
984}
985
987{
988 return _smoothed;
989}
990
991void QQuickDrag::setSmoothed(bool smooth)
992{
993 if (_smoothed != smooth) {
994 _smoothed = smooth;
996 }
997}
998
1000{
1001 return _threshold;
1002}
1003
1005{
1006 if (_threshold != value) {
1007 _threshold = value;
1009 }
1010}
1011
1013{
1014 setThreshold(QGuiApplication::styleHints()->startDragDistance());
1015}
1016
1018{
1019 return _active;
1020}
1021
1023{
1024 if (_active == drag)
1025 return;
1026 _active = drag;
1028}
1029
1031{
1032 return _filterChildren;
1033}
1034
1036{
1037 if (_filterChildren == filter)
1038 return;
1039 _filterChildren = filter;
1041}
1042
1047
1049
1050#include "moc_qquickdrag_p.cpp"
\inmodule QtCore \reentrant
Definition qbuffer.h:16
\inmodule QtCore
Definition qbytearray.h:57
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
\inmodule QtGui
Definition qdrag.h:22
void setHotSpot(const QPoint &hotspot)
Sets the position of the hot spot relative to the top-left corner of the pixmap used to the point spe...
Definition qdrag.cpp:148
Qt::DropAction exec(Qt::DropActions supportedActions=Qt::MoveAction)
Definition qdrag.cpp:201
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
Definition qdrag.cpp:101
void setPixmap(const QPixmap &)
Sets pixmap as the pixmap used to represent the data in a drag and drop operation.
Definition qdrag.cpp:125
\inmodule QtCore
Definition qcoreevent.h:45
static QPlatformIntegration * platformIntegration()
\macro qGuiApp
static QStyleHints * styleHints()
Returns the application's style hints.
The QImageWriter class provides a format independent interface for writing images to files or other d...
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
static QList< QByteArray > supportedMimeTypes()
Returns the list of MIME types supported by QImageWriter.
static QList< QByteArray > imageFormatsForMimeType(const QByteArray &mimeType)
\inmodule QtGui
Definition qimage.h:37
QList< T > toList() const noexcept
Definition qlist.h:723
qsizetype length() const noexcept
Definition qlist.h:399
auto asKeyValueRange() &
Definition qmap.h:614
\inmodule QtCore
Definition qmimedata.h:16
void setHtml(const QString &html)
Sets html as the HTML (MIME type text/html) used to represent the data.
void setData(const QString &mimetype, const QByteArray &data)
Sets the data associated with the MIME type given by mimeType to the specified data.
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
void setImageData(const QVariant &image)
Sets the data in the object to the given image.
void setUrls(const QList< QUrl > &urls)
Sets the URLs stored in the MIME data object to those specified by urls.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition qobject.cpp:1389
void deleteLater()
\threadsafe
Definition qobject.cpp:2435
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
Definition qpixmap.cpp:1437
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition qpoint.h:404
\inmodule QtCore\reentrant
Definition qpoint.h:25
The QQmlContext class defines a context within a QML engine.
Definition qqmlcontext.h:25
Qt::DropAction proposedAction
QQuickDragMimeData * mimeData
QMimeData * createMimeData() const
\qmlattachedsignal QtQuick::Drag::dragStarted()
void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override
\qmltype Drag \instantiates QQuickDrag \inqmlmodule QtQuick
Qt::DropAction startDrag(Qt::DropActions supportedActions)
QQuickDragGrabber dragGrabber
QPointer< QObject > source
void itemParentChanged(QQuickItem *, QQuickItem *parent) override
Qt::DropActions supportedActions
void start(Qt::DropActions supportedActions)
void deliverEvent(QQuickWindow *window, QEvent *event)
QPointer< QQuickWindow > window
void imageSourceSizeChanged()
void setSupportedActions(Qt::DropActions actions)
void setImageSource(const QUrl &url)
QQuickDrag::DragType dragType
void setSource(QObject *item)
void cancel()
\qmlattachedmethod void QtQuick::Drag::cancel()
void setMimeData(const QVariantMap &mimeData)
void setDragType(QQuickDrag::DragType dragType)
void setImageSourceSize(const QSize &size)
void start(QQmlV4FunctionPtr)
\qmlattachedmethod void QtQuick::Drag::start(flags supportedActions)
Qt::DropAction proposedAction
Qt::DropActions supportedActions
void startDrag(QQmlV4FunctionPtr)
\qmlattachedmethod void QtQuick::Drag::startDrag(flags supportedActions)
void setActive(bool active)
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
QQuickDragAttached(QObject *parent)
void proposedActionChanged()
void setKeys(const QStringList &keys)
void setProposedAction(Qt::DropAction action)
QVariantMap mimeData
Q_INVOKABLE int drop()
\qmlattachedmethod enumeration QtQuick::Drag::drop()
bool isActive() const
\qmlattachedproperty bool QtQuick::Drag::active
void setHotSpot(const QPointF &hotSpot)
void supportedActionsChanged()
QObject * target() const
void setXmax(qreal)
void setXmin(qreal)
qreal threshold
void setSmoothed(bool smooth)
void activeChanged()
void maximumXChanged()
void minimumXChanged()
void targetChanged()
void setAxis(Axis)
void setActive(bool)
void resetTarget()
qreal xmin() const
void thresholdChanged()
qreal ymin() const
void setYmax(qreal)
void smoothedChanged()
void setFilterChildren(bool)
qreal ymax() const
void minimumYChanged()
void setTarget(QQuickItem *target)
bool filterChildren
void axisChanged()
QQuickItem * target
qreal xmax() const
void filterChildrenChanged()
void setYmin(qreal)
QQuickDrag(QObject *parent=nullptr)
static QQuickDragAttached * qmlAttachedProperties(QObject *obj)
void resetThreshold()
void maximumYChanged()
void setThreshold(qreal)
void setProposedAction(Qt::DropAction action)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QPointF mapToScene(const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within the scene's coor...
QQuickWindow * window() const
Returns the window in which this item is rendered.
QImage image() const
void load(QQmlEngine *, const QUrl &)
static QQuickWindowPrivate * get(QQuickWindow *c)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
bool isValid() const noexcept
Returns true if this is a valid string converter that can be used for encoding or decoding text.
\inmodule QtCore
Q_WEAK_OVERLOAD DecodedData< const QString & > encode(const QString &str)
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QByteArray toUtf8() const &
Definition qstring.h:634
\inmodule QtCore
Definition qurl.h:94
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
Definition qurl.cpp:1882
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
Definition qurl.cpp:1896
void clear()
Resets the content of the QUrl.
Definition qurl.cpp:1909
QString text
Combined button and popup list for selecting options.
@ NoButton
Definition qnamespace.h:57
@ NoModifier
DropAction
@ IgnoreAction
Definition image.cpp:4
static void * context
#define Q_FALLTHROUGH()
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
const char * mimeType
GLenum GLsizei GLsizei GLint * values
[15]
GLsizei const GLfloat * v
[13]
const GLfloat * m
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLenum GLuint buffer
GLint GLsizei width
GLenum target
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLsizei GLsizei GLchar * source
struct _cl_event * event
GLhandleARB obj
[2]
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
QQmlContext * qmlContext(const QObject *obj)
Definition qqml.cpp:75
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
Definition qquickitem.h:492
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define Q_EMIT
#define emit
ptrdiff_t qsizetype
Definition qtypes.h:165
double qreal
Definition qtypes.h:187
QStringList keys
QUrl url("example.com")
[constructor-url-reference]
QMimeData * mimeData
QObject::connect nullptr
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]
QJSValueList args