DropArea

For specifying drag and drop handling in an area. More...

Import Statement: import QtQuick 2.11

Properties

Signals

Detailed Description

A DropArea is an invisible item which receives events when other items are dragged over it.

The Drag attached property can be used to notify the DropArea when an Item is dragged over it.

The keys property can be used to filter drag events which don't include a matching key.

The drag.source property is communicated to the source of a drag event as the recipient of a drop on the drag target.

See also Qt Quick Examples - Drag and Drop and Qt Quick Examples - externaldraganddrop.

Property Documentation

containsDrag : bool

This property identifies whether the DropArea currently contains any dragged items.


drag group

drag.x : qreal

drag.y : qreal

These properties hold the coordinates of the last drag event.


drag.source : Object

This property holds the source of a drag.


keys : stringlist

This property holds a list of drag keys a DropArea will accept.

If no keys are listed the DropArea will accept events from any drag source, otherwise the drag source must have at least one compatible key.

See also QtQuick::Drag::keys.


Signal Documentation

dropped(DragEvent drop)

This signal is emitted when a drop event occurs within the bounds of a DropArea.

The corresponding handler is onDropped.


entered(DragEvent drag)

This signal is emitted when a drag enters the bounds of a DropArea.

The corresponding handler is onEntered.


exited()

This signal is emitted when a drag exits the bounds of a DropArea.

The corresponding handler is onExited.


positionChanged(DragEvent drag)

This signal is emitted when the position of a drag has changed.

The corresponding handler is onPositionChanged.


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support