DropArea QML Type

用于指定区域中的拖放处理。更多

Import Statement: import QtQuick
Inherits:

Item

属性

信号

详细说明

DropArea 是一个不可见的项目,当其他项目被拖到它上面时,它会接收事件。

Drag attached 属性可用于在项目被拖动到 DropArea 上时通知 DropArea。

keys 属性可用于过滤不包含匹配键的拖动事件。

drag.source 属性将作为拖动目标上的拖放的接收者传达给拖动事件的源。

另请参阅 Qt Quick 示例 - 拖放

属性文档

containsDrag : bool [read-only]

该属性可确定DropArea 当前是否包含任何拖动项。


drag group

drag.x : real [read-only]

drag.y : real [read-only]

这些属性保存最后一次拖动事件的坐标。


drag.source : QtObject [read-only]

该属性包含拖动的源。


keys : stringlist

此属性包含DropArea 将接受的拖动键列表。

如果未列出任何键,DropArea 将接受来自任何拖动源的事件,否则拖动源必须至少有一个兼容键。

另请参阅 QtQuick::Drag::keys


信号文档

dropped(DragEvent drop)

drop 事件发生在DropArea 的范围内时,将发出该信号。

注: 相应的处理程序是onDropped


entered(DragEvent drag)

drag 进入DropArea 的范围时,发出该信号。

注: 相应的处理程序为onEntered


exited()

当拖动退出DropArea 的边界时,会发出该信号。

注: 相应的处理程序是onExited


positionChanged(DragEvent drag)

drag 的位置发生变化时,将发出该信号。

注: 相应的处理程序是onPositionChanged


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.