QDragMoveEvent Class Reference
[QtGui module]
该类提供一个事件,它被发出,当一个拖放动作正在运行。
#include <QDragMoveEvent>
公共函数:
QDragMoveEvent ( const QPoint & pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove )
 
void
accept ( const QRect & rectangle )
void
accept ()
QRect
answerRect () const
void
ignore ( const QRect & rectangle )
void
ignore ()
详细描述:
一个widget将接受拖动事件重复的,当拖是在他的边界内。如果他接受drop events
enter eventsWidget应该仔细检查事件来看它支持的那种数据,调用accept() 函数来接受drop
矩形应用通过answerRect() 函数能被用来限制放到一定区域的widget。例如,我们能检查是否矩形界面带有一定child widget的几何特性,如果那样,只调用acceptProposedAction()
注意该类继承大多数他的函数从QDropEvent
成员函数文件:

QDragMoveEvent::QDragMoveEvent ( const QPoint & pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove )

 创造一个 QDragMoveEvent,按照要求的type,代表鼠标是在pos位置。鼠标和键盘状态定位被buttonsmodifiers。动作描述拖放操作类型是可能的。拖动数据被传到MIME编码的信息。

QDragMoveEvent::~QDragMoveEvent ()

void QDragMoveEvent::accept ( const QRect & rectangle )

accept()相同。但是也通知将来的操作将也被接受,如果他们保持在rectangle内。这能提高表现,但是也可能被根本的系统忽略。
如果矩形是空的,拖动事件将被持续发出。这是有用的,如果资源被扔进一个时间事件中。

void QDragMoveEvent::accept ()

QRect QDragMoveEvent::answerRect () const

返回矩形,那里放事件将发生。你能使用这个信息来限制放到一定得地方。

void QDragMoveEvent::ignore ( const QRect & rectangle )

接受的反操作。在这个矩形内移动是不允许的。

void QDragMoveEvent::ignore ()