• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QDropEvent

    下一话题

    QDragEnterEvent

    QDragMoveEvent

    继承者: QDragEnterEvent

    概要

    函数

    详细描述

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

    A widget will receive drag move events repeatedly while the drag is within its boundaries, if it accepts drop events and enter events . The widget should examine the event to see what kind of data it PySide.QtGui.QDragMoveEvent.provides() , and call the PySide.QtGui.QDragMoveEvent.accept() function to accept the drop if appropriate.

    The rectangle supplied by the PySide.QtGui.QDragMoveEvent.answerRect() function can be used to restrict drops to certain parts of the widget. For example, we can check whether the rectangle intersects with the geometry of a certain child widget and only call PySide.QtGui.QDropEvent.acceptProposedAction() if that is the case.

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

    class PySide.QtGui. QDragMoveEvent ( pos , actions , data , buttons , modifiers [ , type=DragMove ] )
    参数:
    PySide.QtGui.QDragMoveEvent. accept ( r )
    参数: r PySide.QtCore.QRect

    如同 PySide.QtGui.QDragMoveEvent.accept() , but also notifies that future moves will also be acceptable if they remain within the rectangle given on the widget. This can improve performance, but may also be ignored by the underlying system.

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

    PySide.QtGui.QDragMoveEvent. answerRect ( )
    返回类型: PySide.QtCore.QRect

    Returns the rectangle in the widget where the drop will occur if accepted. You can use this information to restrict drops to certain places on the widget.

    PySide.QtGui.QDragMoveEvent. ignore ( r )
    参数: r PySide.QtCore.QRect

    The opposite of the accept(const PySide.QtCore.QRect &) function. Moves within the rectangle are not acceptable, and will be ignored.