nodeguy/website/docs/api/generated/classes/qdrag.md
2020-07-04 20:03:59 +02:00

5.3 KiB
Raw Blame History

id title sidebar_label
qdrag QDrag QDrag

description

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QDrag(arg?: NativeElement | QObject): QDrag

Overrides Component.constructor

Parameters:

Name Type
arg? NativeElement | QObject

Returns: QDrag

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: SetComponent

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

defaultAction

defaultAction(): DropAction

Returns the default proposed drop action for this drag operation.

Returns: DropAction


dragCursor

dragCursor(action: DropAction): QPixmap

Returns the drag cursor for the action.

Parameters:

Name Type
action DropAction

Returns: QPixmap


exec

exec(supportedActions: number, defaultDropAction?: DropAction): DropAction

Starts the drag and drop operation and returns a value indicating the requested drop action when it is completed. The drop actions that the user can choose from are specified in supportedActions. The default proposed action will be selected among the allowed actions in the following order: Move, Copy and Link.

Parameters:

Name Type Default
supportedActions number DropAction.MoveAction
defaultDropAction? DropAction -

Returns: DropAction


hotSpot

hotSpot(): QPoint

Returns the position of the hot spot relative to the top-left corner of the cursor.

Returns: QPoint


mimeData

mimeData(): QMimeData

Returns the MIME data that is encapsulated by the drag object.

Returns: QMimeData


pixmap

pixmap(): QPixmap

Returns the pixmap used to represent the data in a drag and drop operation.

Returns: QPixmap


setDragCursor

setDragCursor(cursor: QPixmap, action: DropAction): void

Sets the drag cursor for the action. This allows you to override the default native cursors. To revert to using the native cursor for action pass in a null QPixmap as cursor.

Parameters:

Name Type
cursor QPixmap
action DropAction

Returns: void


setHotSpot

setHotSpot(hotspot: QPoint): void

Sets the position of the hot spot relative to the top-left corner of the pixmap used to the point specified by hotspot.

Parameters:

Name Type
hotspot QPoint

Returns: void


setMimeData

setMimeData(data: QMimeData): void

Sets the data to be sent to the given MIME data. Ownership of the data is transferred to the QDrag object.

Parameters:

Name Type
data QMimeData

Returns: void


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

Name Type
parent? Component

Returns: void


setPixmap

setPixmap(pixmap: QPixmap): void

Sets pixmap as the pixmap used to represent the data in a drag and drop operation. You can only set a pixmap before the drag is started.

Parameters:

Name Type
pixmap QPixmap

Returns: void


supportedActions

supportedActions(): number

Returns the set of possible drop actions for this drag operation.

Returns: number


Static cancel

cancel(): void

Cancels a drag operation initiated by Qt.

Returns: void