返回介绍

QDragMoveEvent Class

发布于 2019-10-04 14:59:56 字数 2232 浏览 1006 评论 0 收藏 0

The QDragMoveEvent class provides an event which is sent while a drag and drop is in progress. More...

#include <qevent.h>

Inherits QDropEvent.

Inherited by QDragEnterEvent.

List of all member functions.

Public Members

  • QDragMoveEvent ( constQPoint&pos, Typetype = DragMove )
  • QRect answerRect () const
  • void accept ( constQRect&r )
  • void ignore ( constQRect&r )

Detailed Description

The QDragMoveEvent class provides an event which is sent while a drag and drop is in progress.

When a widget accepts drop events, it will receive this event repeatedly while the drag is within the widget's boundaries. The widget should examine the event to see what data it provides, and accept() the drop if appropriate.

Note that this class inherits most of its functionality from QDropEvent.

See also Drag And Drop Classes and Event Classes.


Member Function Documentation

QDragMoveEvent::QDragMoveEvent ( constQPoint&pos, Typetype = DragMove )

Creates a QDragMoveEvent for which the mouse is at point pos, and the event is of type type.

Warning: Do not create a QDragMoveEvent yourself since these objects rely on Qt's internal state.

void QDragMoveEvent::accept ( constQRect&r )

The same as accept(), but also notifies that future moves will also be acceptable if they remain within the rectangle r on the widget: this can improve performance, but may also be ignored by the underlying system.

If the rectangle is empty, then drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.

Examples: desktop/desktop.cpp and dirview/dirview.cpp.

QRect QDragMoveEvent::answerRect () const

Returns the rectangle for which the acceptance of the move event applies.

void QDragMoveEvent::ignore ( constQRect&r )

The opposite of accept(const QRect&), i.e. says that moves within rectangle r are not acceptable (will be ignored).

Example: dirview/dirview.cpp.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文