Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QCocoaDrag Class Reference

#include <qcocoadrag.h>

+ Inheritance diagram for QCocoaDrag:
+ Collaboration diagram for QCocoaDrag:

Public Member Functions

 QCocoaDrag ()
 
 ~QCocoaDrag ()
 
QMimeDatadragMimeData ()
 
Qt::DropAction drag (QDrag *m_drag) override
 
Qt::DropAction defaultAction (Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override
 
void setLastMouseEvent (NSEvent *event, NSView *view)
 
void setAcceptedAction (Qt::DropAction act)
 
void exitDragLoop ()
 
- Public Member Functions inherited from QPlatformDrag
 QPlatformDrag ()
 
virtual ~QPlatformDrag ()
 
QDragcurrentDrag () const
 
virtual Qt::DropAction drag (QDrag *m_drag)=0
 
virtual void cancelDrag ()
 Cancels the currently active drag (only for drags of the current application initiated by QPlatformDrag::drag()).
 
void updateAction (Qt::DropAction action)
 Called to notify QDrag about changes of the current action.
 
virtual Qt::DropAction defaultAction (Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const
 
virtual bool ownsDragObject () const
 Returns bool indicating whether QPlatformDrag takes ownership and therefore responsibility of deleting the QDrag object passed in from QPlatformDrag::drag. This can be useful on platforms where QDrag object has to be kept around.
 

Additional Inherited Members

- Static Public Member Functions inherited from QPlatformDrag
static QPixmap defaultPixmap ()
 

Detailed Description

Definition at line 22 of file qcocoadrag.h.

Constructor & Destructor Documentation

◆ QCocoaDrag()

QCocoaDrag::QCocoaDrag ( )

Definition at line 22 of file qcocoadrag.mm.

◆ ~QCocoaDrag()

QCocoaDrag::~QCocoaDrag ( )

Definition at line 29 of file qcocoadrag.mm.

References release().

+ Here is the call graph for this function:

Member Function Documentation

◆ defaultAction()

Qt::DropAction QCocoaDrag::defaultAction ( Qt::DropActions  possibleActions,
Qt::KeyboardModifiers  modifiers 
) const
overridevirtual

Reimplemented from QPlatformDrag.

Definition at line 49 of file qcocoadrag.mm.

References Qt::AltModifier, Qt::ControlModifier, Qt::CopyAction, QPlatformDrag::currentDrag(), QDrag::defaultAction(), Qt::IgnoreAction, Qt::LinkAction, Qt::MoveAction, qDebug, and QDrag::supportedActions().

+ Here is the call graph for this function:

◆ drag()

Qt::DropAction QCocoaDrag::drag ( QDrag m_drag)
overridevirtual

Implements QPlatformDrag.

Definition at line 96 of file qcocoadrag.mm.

References at, QUtiMimeConverter::DnD, QDrag::hotSpot(), Qt::IgnoreAction, QMacPasteboard::LazyRequest, QDrag::mimeData(), o, Q_ASSERT, QMimeData::setData(), QMacPasteboard::setMimeData(), QPixmap::toImage(), window(), QPoint::x(), and QPoint::y().

+ Here is the call graph for this function:

◆ dragMimeData()

QMimeData * QCocoaDrag::dragMimeData ( )

Definition at line 41 of file qcocoadrag.mm.

References QDrag::mimeData().

+ Here is the call graph for this function:

◆ exitDragLoop()

void QCocoaDrag::exitDragLoop ( )

Definition at line 227 of file qcocoadrag.mm.

References QEventLoop::exit(), QEventLoop::isRunning(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ setAcceptedAction()

void QCocoaDrag::setAcceptedAction ( Qt::DropAction  act)

Definition at line 222 of file qcocoadrag.mm.

◆ setLastMouseEvent()

void QCocoaDrag::setLastMouseEvent ( NSEvent *  event,
NSView *  view 
)

to meet NSView dragImage:at guarantees, we need to record the original event and view when handling an event in QNSView

Definition at line 34 of file qcocoadrag.mm.

References copy(), release(), and view.

+ Here is the call graph for this function:

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