QDragMoveEvent Class Reference
[QtGui module]<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
该类提供一个事件,它被发出,当一个拖放动作正在运行。
#include <QDragMoveEvent>
公共函数:
QDragMoveEvent
( const QPoint &
pos
, Qt::DropActions
actions
, const QMimeData *data, Qt::MouseButtons
buttons
, Qt::KeyboardModifiers
modifiers
, Type
type
= DragMove )
| |
| |
void
| |
void
| |
QRect
| |
void
| |
void
|
详细描述:
矩形应用通过
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
位置。鼠标和键盘状态定位被
buttons
和
modifiers
。动作描述拖放操作类型是可能的。拖动数据被传到
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 ()
转载于:https://blog.51cto.com/no001/278781