Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickDragAttachedPrivate Class Reference

#include <qquickdrag_p_p.h>

+ Inheritance diagram for QQuickDragAttachedPrivate:
+ Collaboration diagram for QQuickDragAttachedPrivate:

Public Member Functions

 QQuickDragAttachedPrivate ()
 
void itemGeometryChanged (QQuickItem *, QQuickGeometryChange, const QRectF &) override
 \qmltype Drag \nativetype QQuickDrag \inqmlmodule QtQuick
 
void itemParentChanged (QQuickItem *, QQuickItem *parent) override
 
void updatePosition ()
 
void restartDrag ()
 
void deliverEnterEvent ()
 
void deliverMoveEvent ()
 
void deliverLeaveEvent ()
 
void deliverEvent (QQuickWindow *window, QEvent *event)
 
void start (Qt::DropActions supportedActions)
 
Qt::DropAction startDrag (Qt::DropActions supportedActions)
 
void setTarget (QQuickItem *item)
 
QMimeDatacreateMimeData () const
 \qmlattachedsignal QtQuick::Drag::dragStarted()
 
void loadPixmap ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
void setObjectNameWithoutBindings (const QString &name)
 
 QObjectPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
const QMetaObjectdynamicMetaObject () const
 
- Public Member Functions inherited from QSafeQuickItemChangeListener< QQuickDragAttachedPrivate >
 ~QSafeQuickItemChangeListener () override
 
bool baseDeleted (const QObject *caller) const override
 
QString debugName () const override
 
- Public Member Functions inherited from QQuickItemChangeListener
virtual ~QQuickItemChangeListener ()
 
virtual void itemSiblingOrderChanged (QQuickItem *)
 
virtual void itemVisibilityChanged (QQuickItem *)
 
virtual void itemEnabledChanged (QQuickItem *)
 
virtual void itemOpacityChanged (QQuickItem *)
 
virtual void itemDestroyed (QQuickItem *)
 
virtual void itemChildAdded (QQuickItem *, QQuickItem *)
 
virtual void itemChildRemoved (QQuickItem *, QQuickItem *)
 
virtual void itemRotationChanged (QQuickItem *)
 
virtual void itemImplicitWidthChanged (QQuickItem *)
 
virtual void itemImplicitHeightChanged (QQuickItem *)
 
virtual void itemFocusChanged (QQuickItem *, Qt::FocusReason)
 
virtual void itemScaleChanged (QQuickItem *)
 
virtual void itemTransformChanged (QQuickItem *, QQuickItem *)
 
virtual QQuickAnchorsPrivateanchorPrivate ()
 
virtual void addSourceItem (QQuickItem *)
 
virtual void removeSourceItem (QQuickItem *)
 

Static Public Member Functions

static QQuickDragAttachedPrivateget (QQuickDragAttached *attached)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QQuickDragGrabber dragGrabber
 
QPointer< QObjectsource
 
QPointer< QObjecttarget
 
QPointer< QQuickWindowwindow
 
QQuickItemattachedItem
 
QQuickDragMimeDatamimeData
 
Qt::DropAction proposedAction
 
Qt::DropActions supportedActions
 
bool active: 1
 
bool listening: 1
 
bool inEvent: 1
 
bool dragRestarted: 1
 
bool itemMoved: 1
 
bool eventQueued: 1
 
bool overrideActions: 1
 
QPointF hotSpot
 
QUrl imageSource
 
QSize imageSourceSize
 
QQuickPixmap pixmapLoader
 
QStringList keys
 
QVariantMap externalMimeData
 
QQuickDrag::DragType dragType
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 
- Public Types inherited from QSafeQuickItemChangeListener< QQuickDragAttachedPrivate >
using InDestructorTest
 
using WasDeletedTest
 

Detailed Description

Definition at line 32 of file qquickdrag_p_p.h.

Constructor & Destructor Documentation

◆ QQuickDragAttachedPrivate()

QQuickDragAttachedPrivate::QQuickDragAttachedPrivate ( )
inline

Definition at line 43 of file qquickdrag_p_p.h.

Member Function Documentation

◆ createMimeData()

QMimeData * QQuickDragAttachedPrivate::createMimeData ( ) const

\qmlattachedsignal QtQuick::Drag::dragStarted()

This signal is emitted when a drag is started with the \l startDrag() method or when it is started automatically using the \l dragType property.

\qmlattachedsignal QtQuick::Drag::dragFinished(DropAction dropAction)

This signal is emitted when a drag finishes and the drag was started with the \l startDrag() method or started automatically using the \l dragType property.

dropAction holds the action accepted by the target item.

See also
drop()

Definition at line 724 of file qquickdrag.cpp.

◆ deliverEnterEvent()

void QQuickDragAttachedPrivate::deliverEnterEvent ( )

Definition at line 102 of file qquickdrag.cpp.

◆ deliverEvent()

void QQuickDragAttachedPrivate::deliverEvent ( QQuickWindow * window,
QEvent * event )

Definition at line 148 of file qquickdrag.cpp.

◆ deliverLeaveEvent()

void QQuickDragAttachedPrivate::deliverLeaveEvent ( )

Definition at line 139 of file qquickdrag.cpp.

◆ deliverMoveEvent()

void QQuickDragAttachedPrivate::deliverMoveEvent ( )

Definition at line 122 of file qquickdrag.cpp.

◆ get()

static QQuickDragAttachedPrivate * QQuickDragAttachedPrivate::get ( QQuickDragAttached * attached)
inlinestatic

Definition at line 40 of file qquickdrag_p_p.h.

◆ itemGeometryChanged()

void QQuickDragAttachedPrivate::itemGeometryChanged ( QQuickItem * ,
QQuickGeometryChange change,
const QRectF &  )
overridevirtual

\qmltype Drag \nativetype QQuickDrag \inqmlmodule QtQuick

For specifying drag and drop events for moved Items.

Using the Drag attached property, any Item can be made a source of drag and drop events within a scene.

When a drag is \l active on an item, any change in that item's position will generate a drag event that will be sent to any DropArea that intersects with the new position of the item. Other items which implement drag and drop event handlers can also receive these events.

The following snippet shows how an item can be dragged with a MouseArea. However, dragging is not limited to mouse drags; anything that can move an item can generate drag events, including touch events, animations and bindings.

import QtQuick
Item {
width: 200; height: 200
DropArea {
x: 75; y: 75
width: 50; height: 50
Rectangle {
anchors.fill: parent
color: "green"
visible: parent.containsDrag
}
}
Rectangle {
x: 10; y: 10
width: 20; height: 20
color: "red"
Drag.active: dragArea.drag.active
Drag.hotSpot.x: 10
Drag.hotSpot.y: 10
MouseArea {
id: dragArea
anchors.fill: parent
drag.target: parent
}
}
}

A drag can be terminated either by canceling it with Drag.cancel() or setting Drag.active to false, or it can be terminated with a drop event by calling Drag.drop(). If the drop event is accepted, Drag.drop() will return the \l {supportedActions}{drop action} chosen by the recipient of the event, otherwise it will return Qt.IgnoreAction.

See also
{Qt Quick Examples - Drag and Drop}

Reimplemented from QQuickItemChangeListener.

Definition at line 61 of file qquickdrag.cpp.

◆ itemParentChanged()

void QQuickDragAttachedPrivate::itemParentChanged ( QQuickItem * ,
QQuickItem * parent )
overridevirtual

Reimplemented from QQuickItemChangeListener.

Definition at line 69 of file qquickdrag.cpp.

◆ loadPixmap()

void QQuickDragAttachedPrivate::loadPixmap ( )

Definition at line 827 of file qquickdrag.cpp.

◆ restartDrag()

void QQuickDragAttachedPrivate::restartDrag ( )

Definition at line 92 of file qquickdrag.cpp.

◆ setTarget()

void QQuickDragAttachedPrivate::setTarget ( QQuickItem * item)

◆ start()

void QQuickDragAttachedPrivate::start ( Qt::DropActions supportedActions)

Definition at line 556 of file qquickdrag.cpp.

◆ startDrag()

Qt::DropAction QQuickDragAttachedPrivate::startDrag ( Qt::DropActions supportedActions)

Definition at line 838 of file qquickdrag.cpp.

◆ updatePosition()

void QQuickDragAttachedPrivate::updatePosition ( )

Definition at line 82 of file qquickdrag.cpp.

Member Data Documentation

◆ active

bool QQuickDragAttachedPrivate::active

Definition at line 82 of file qquickdrag_p_p.h.

◆ attachedItem

QQuickItem* QQuickDragAttachedPrivate::attachedItem

Definition at line 78 of file qquickdrag_p_p.h.

◆ dragGrabber

QQuickDragGrabber QQuickDragAttachedPrivate::dragGrabber

Definition at line 73 of file qquickdrag_p_p.h.

◆ dragRestarted

bool QQuickDragAttachedPrivate::dragRestarted

Definition at line 85 of file qquickdrag_p_p.h.

◆ dragType

QQuickDrag::DragType QQuickDragAttachedPrivate::dragType

Definition at line 95 of file qquickdrag_p_p.h.

◆ eventQueued

bool QQuickDragAttachedPrivate::eventQueued

Definition at line 87 of file qquickdrag_p_p.h.

◆ externalMimeData

QVariantMap QQuickDragAttachedPrivate::externalMimeData

Definition at line 94 of file qquickdrag_p_p.h.

◆ hotSpot

QPointF QQuickDragAttachedPrivate::hotSpot

Definition at line 89 of file qquickdrag_p_p.h.

◆ imageSource

QUrl QQuickDragAttachedPrivate::imageSource

Definition at line 90 of file qquickdrag_p_p.h.

◆ imageSourceSize

QSize QQuickDragAttachedPrivate::imageSourceSize

Definition at line 91 of file qquickdrag_p_p.h.

◆ inEvent

bool QQuickDragAttachedPrivate::inEvent

Definition at line 84 of file qquickdrag_p_p.h.

◆ itemMoved

bool QQuickDragAttachedPrivate::itemMoved

Definition at line 86 of file qquickdrag_p_p.h.

◆ keys

QStringList QQuickDragAttachedPrivate::keys

Definition at line 93 of file qquickdrag_p_p.h.

◆ listening

bool QQuickDragAttachedPrivate::listening

Definition at line 83 of file qquickdrag_p_p.h.

◆ mimeData

QQuickDragMimeData* QQuickDragAttachedPrivate::mimeData

Definition at line 79 of file qquickdrag_p_p.h.

◆ overrideActions

bool QQuickDragAttachedPrivate::overrideActions

Definition at line 88 of file qquickdrag_p_p.h.

◆ pixmapLoader

QQuickPixmap QQuickDragAttachedPrivate::pixmapLoader

Definition at line 92 of file qquickdrag_p_p.h.

◆ proposedAction

Qt::DropAction QQuickDragAttachedPrivate::proposedAction

Definition at line 80 of file qquickdrag_p_p.h.

◆ source

QPointer<QObject> QQuickDragAttachedPrivate::source

Definition at line 75 of file qquickdrag_p_p.h.

◆ supportedActions

Qt::DropActions QQuickDragAttachedPrivate::supportedActions

Definition at line 81 of file qquickdrag_p_p.h.

◆ target

QPointer<QObject> QQuickDragAttachedPrivate::target

Definition at line 76 of file qquickdrag_p_p.h.

◆ window

QPointer<QQuickWindow> QQuickDragAttachedPrivate::window

Definition at line 77 of file qquickdrag_p_p.h.


The documentation for this class was generated from the following files: