DropArea QML Type

For specifying drag and drop handling in an area 更多...

导入语句: import QtQuick 2.7

特性

信号

详细描述

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

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

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

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

另请参阅 Qt Quick 范例 - 拖放 and Qt Quick Examples - externaldraganddrop .

特性文档编制

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.

另请参阅 QtQuick::Drag::keys .


信号文档编制

dropped ( DragEvent drop )

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

相应处理程序是 onDropped .


entered ( DragEvent drag )

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

相应处理程序是 onEntered .


exited ()

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

相应处理程序是 onExited .


positionChanged ( DragEvent drag )

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

相应处理程序是 onPositionChanged .