The QDragMoveEvent 類提供發送的事件,在拖放動作進行期間。 更多...
| 頭: | #include <QDragMoveEvent> |
| qmake: | QT += gui |
| 繼承: | QDropEvent |
| 繼承者: | QDragEnterEvent |
| QDragMoveEvent (const QPoint & pos , Qt::DropActions actions , const QMimeData * data , Qt::MouseButtons buttons , Qt::KeyboardModifiers modifiers , Type type = DragMove) | |
| ~QDragMoveEvent () | |
| void | accept (const QRect & rectangle ) |
| void | accept () |
| QRect | answerRect () const |
| void | ignore (const QRect & rectangle ) |
| void | ignore () |
The QDragMoveEvent 類提供發送的事件,在拖放動作進行期間。
widget 將重復接收拖拽移動事件,當在其邊界內拖拽時,若它接受 掉落事件 and 進入事件 。Widget 應審查事件,以查看何種 data 它提供瞭,並調用 accept () 函數以接受掉落,若閤適。
矩形供給通過 answerRect () 函數可以用於將掉落,限定到 Widget 的某些部分。例如,可以校驗矩形是否與某個子級 Widget 的幾何體相交,然後僅調用 acceptProposedAction() 若是這種情況。
注意,此類繼承瞭大部分功能從 QDropEvent .
另請參閱 QDragEnterEvent , QDragLeaveEvent ,和 QDropEvent .
創建 QDragMoveEvent of the required type 指示鼠標是在位置 pos 給定於 Widget。
鼠標和鍵盤的狀態的指定是通過 buttons and modifiers ,和 actions describe the types of drag and drop operation that are possible. The drag data is passed as MIME-encoded information in data .
警告: Do not attempt to create a QDragMoveEvent yourself. These objects rely on Qt's internal state.
銷毀事件。
如同 accept (), but also notifies that future moves will also be acceptable if they remain within the rectangle 給定由 widget。這可以改進性能,但還可能被底層係統所忽略。
If the rectangle is empty, drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.
這是重載函數。
調用 QDropEvent::accept ().
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.
相反於 accept(const QRect &) 函數。移動在 rectangle 不可接受,且會被忽略。
這是重載函數。
調用 QDropEvent::ignore ().