拖放一个文件进入窗口时将触发拖放事件
每个 QWidget 对象都能够处理拖放事件
拖放事件的处理函数为
-- [virtual protected] void QWidget::dragEnterEvent(QDragEnterEvent *event)
-- [virtual protected] void QWidget::dropEvent(QDropEvent *event)
[virtual protected] void QWidget::dragEnterEvent(QDragEnterEvent *event)
/*
This event handler is called when a drag is in progress and the mouse enters this widget. The event is passed in the event parameter.
If the event is ignored, the widget won't receive any drag move events.
See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
See also QDrag and QDragEnterEvent.
*/
[virtual protected] void QWidget::dragLeaveEvent(QDragLeaveEvent *event)
/*
This event handler is called when a drag is