QDragMoveEvent Class
QDragMoveEvent 클래스는 드래그 앤 드롭 작업이 진행되는 동안 전송되는 이벤트를 제공합니다. 더 보기...
| 헤더: | #include <QDragMoveEvent> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 상속: | QDropEvent |
| 상속받는 클래스: |
- 상속받은 멤버를 포함한 모든 멤버 목록
- 사용 중단된 멤버
- QDragMoveEvent는 이벤트 클래스의 일부입니다.
공개 함수
| QDragMoveEvent(QPointF pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = DragMove) | |
| void | accept(const QRect &rectangle) |
| void | accept() |
| QRect | answerRect() const |
| void | ignore(const QRect &rectangle) |
| void | ignore() |
보호된 함수
| QDragMoveEvent(QDragMoveEvent &&) | |
| QDragMoveEvent & | operator=(QDragMoveEvent &&) |
| QDragMoveEvent & | operator=(const QDragMoveEvent &other) |
상세 설명
위젯이 ` drop events ` 및 ` enter events`을 허용하는 경우, 드래그가 위젯 경계 내에서 이루어지는 동안 드래그 이동 이벤트를 반복적으로 수신합니다. 위젯은 이벤트를 검사하여 어떤 종류의 ` data `을 제공하는지 확인하고, 적절한 경우 ` accept()` 함수를 호출하여 드롭을 허용해야 합니다.
answerRect() 함수가 반환하는 사각형을 사용하여 드롭을 위젯의 특정 영역으로 제한할 수 있습니다. 예를 들어, 해당 사각형이 특정 자식 위젯의 기하 구조와 교차하는지 확인하고, 교차하는 경우에만 acceptProposedAction()를 호출할 수 있습니다.
이 클래스는 대부분의 기능을 QDropEvent 에서 상속받습니다.
QDragEnterEvent, QDragLeaveEvent 및 QDropEvent도 참조하십시오 .
멤버 함수 문서
QDragMoveEvent::QDragMoveEvent(QPointF pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = DragMove)
위젯 내에서 지정된 위치 pos 에 마우스가 있음을 나타내는, 필요한 type 를 가진 QDragMoveEvent를 생성합니다.
마우스 및 키보드 상태는 ` buttons `와 ` modifiers`로 지정되며, ` actions `는 가능한 드래그 앤 드롭 작업의 유형을 설명합니다. 드래그 데이터는 ` data`에 MIME 인코딩된 정보로 전달됩니다.
경고: QDragMoveEvent를 직접 생성하려고 시도하지마십시오 . 이 객체들은 Qt의 내부 상태에 의존합니다.
[protected delete] QDragMoveEvent::QDragMoveEvent(QDragMoveEvent &&)
QDragMoveEvent 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.
void QDragMoveEvent::accept(const QRect &rectangle)
accept()와 동일하지만, 위젯에 지정된 rectangle 범위 내에서 이루어지는 향후 이동도 허용될 것임을 알립니다. 이는 성능을 향상시킬 수 있지만, 기본 시스템에서 무시될 수도 있습니다.
사각형이 비어 있는 경우, 드래그 이동 이벤트가 지속적으로 전송됩니다. 이는 소스가 타이머 이벤트 내에서 스크롤되고 있을 때 유용합니다.
void QDragMoveEvent::accept()
QDropEvent::accept()를 호출합니다.
이 함수는 오버로드된 함수입니다.
QRect QDragMoveEvent::answerRect() const
수락될 경우 드롭이 발생할 위젯 내의 사각형을 반환합니다. 이 정보를 사용하여 드롭이 위젯의 특정 위치로만 이루어지도록 제한할 수 있습니다.
void QDragMoveEvent::ignore(const QRect &rectangle)
accept(const QRect&) 함수의 반대 기능입니다. ` rectangle ` 내부의 이동은 허용되지 않으며, 무시됩니다.
void QDragMoveEvent::ignore()
QDropEvent::ignore()를 호출합니다.
이 함수는 오버로드된 함수입니다.
[protected delete] QDragMoveEvent &QDragMoveEvent::operator=(QDragMoveEvent &&)
other 를 이 QDragMoveEvent 인스턴스에 할당합니다. 이 함수는 삭제되었습니다.
[noexcept protected default] QDragMoveEvent &QDragMoveEvent::operator=(const QDragMoveEvent &other)
other 를 이 QDragMoveEvent 인스턴스에 복사-할당합니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.