이 페이지에서

QInputEvent Class

QInputEvent 클래스는 사용자 입력을 설명하는 이벤트의 기본 클래스입니다. 더 보기...

헤더: #include <QInputEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
상속: QEvent
상속받는 항목:

QContextMenuEvent, QKeyEvent 및 QPointerEvent

공개 함수

(since 6.0) const QInputDevice *device() const
QInputDevice::DeviceType deviceType() const
Qt::KeyboardModifiers modifiers() const
quint64 timestamp() const

보호된 함수

QInputEvent(QInputEvent &&)
QInputEvent &operator=(QInputEvent &&)
QInputEvent &operator=(const QInputEvent &other)

상세 설명

멤버 함수 설명

[protected delete] QInputEvent::QInputEvent(QInputEvent &&)

QInputEvent 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.

[since 6.0] const QInputDevice *QInputEvent::device() const

원본 이벤트를 생성한 소스 장치를 반환합니다.

터치 이벤트에서 생성된 마우스 이벤트와 같은 합성 이벤트의 경우, ` device() `는 계속해서 터치스크린 장치를 반환하므로, 해당 이벤트가 실제 마우스에서 발생한 것이 아님을 알 수 있습니다. 따라서 ` mouseEvent.source()->type() != QInputDevice::DeviceType::Mouse `는 Qt 5의 ` mouseEvent.source() == Qt::MouseEventSynthesizedByQt` 표현식을 대체할 수 있는 방법 중 하나입니다.

이 함수는 Qt 6.0에서 도입되었습니다.

QPointerEvent::pointingDevice()도 참조하십시오 .

QInputDevice::DeviceType QInputEvent::deviceType() const

이벤트를 발생시킨 장치의 유형을 반환합니다.

Qt::KeyboardModifiers QInputEvent::modifiers() const

이벤트가 발생하기 직전에 존재했던 키보드 수정자 플래그를 반환합니다.

QGuiApplication::keyboardModifiers()도 참조하십시오 .

quint64 QInputEvent::timestamp() const

이 이벤트에 대한 윈도우 시스템의 타임스탬프를 반환합니다. 일반적으로 시스템이 시작된 시점과 같은 임의의 시점부터 경과한 시간을 밀리초 단위로 나타냅니다.

[protected delete] QInputEvent &QInputEvent::operator=(QInputEvent &&)

other 를 이 QInputEvent 인스턴스에 할당합니다. 이 함수는 삭제됩니다.

[noexcept protected default] QInputEvent &QInputEvent::operator=(const QInputEvent &other)

other 을 이 QInputEvent 인스턴스에 복사-할당합니다.

© 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.