QPointingDevice Class
QPointingDevice 클래스는 마우스, 터치 또는 태블릿 이벤트가 발생하는 장치를 정의합니다. 더 보기...
| 헤더: | #include <QPointingDevice> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 다음부터: | Qt 6.0 |
| 상속: | QInputDevice |
- 상속된 멤버를 포함한 모든 멤버 목록
- 사용 중단된 멤버
- QPointingDevice는 이벤트 클래스의 일부입니다.
공개 유형
| enum | GrabTransition { GrabExclusive, UngrabExclusive, CancelGrabExclusive, GrabPassive, UngrabPassive, …, OverrideGrabPassive } |
| enum class | PointerType { Unknown, Generic, Finger, Pen, Eraser, …, AllPointerTypes } |
| flags | PointerTypes |
속성
- buttonCount : const int
- maximumPoints : const int
- pointerType : const PointerType
- uniqueId : const QPointingDeviceUniqueId
공개 함수
| QPointingDevice(QObject *parent = nullptr) | |
| QPointingDevice(const QString &name, qint64 id, QInputDevice::DeviceType deviceType, QPointingDevice::PointerType pointerType, QInputDevice::Capabilities capabilities, int maxPoints, int buttonCount, const QString &seatName = QString(), QPointingDeviceUniqueId uniqueId = QPointingDeviceUniqueId(), QObject *parent = nullptr) | |
| int | buttonCount() const |
| int | maximumPoints() const |
| QPointingDevice::PointerType | pointerType() const |
| QPointingDeviceUniqueId | uniqueId() const |
신호
| void | grabChanged(QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point) const |
정적 공용 멤버
| const QPointingDevice * | primaryPointingDevice(const QString &seatName = QString()) |
보호된 함수
| QPointingDevice(const QPointingDevice &) | |
| QPointingDevice(QPointingDevice &&) | |
| QPointingDevice & | operator=(QPointingDevice &&) |
| QPointingDevice & | operator=(const QPointingDevice &) |
상세 설명
각 ` QPointerEvent `는 유형 및 기능과 같은 장치별 속성에 접근할 수 있도록 `QPointingDevice` 포인터를 포함합니다. 포인터 이벤트를 생성하기 전에 `QWindowSystemInterface`를 통해 사용 가능한 포인팅 장치를 등록하는 것은 플랫폼이나 일반 플러그인의 책임입니다. 애플리케이션은 이 클래스를 인스턴스화할 필요가 없으며, ` QPointerEvent::device()`가 가리키는 전역 인스턴스에 접근하기만 하면 됩니다.
멤버 유형 문서
enum QPointingDevice::GrabTransition
이 열거형은 한 객체( nullptr 일 수 있음)에서 다른 객체( nullptr 일 수 있음)로의 배타적 또는 수동적 그랩 전환을 나타냅니다. 이는 QPointingDevice::grabChanged() 신호의 인자로 전송됩니다.
유효한 값은 다음과 같습니다:
| 상수 | 값 | 설명 |
|---|---|---|
QPointingDevice::GrabExclusive | 0x10 | QPointerEvent::setExclusiveGrabber() 호출 후 발생합니다. |
QPointingDevice::UngrabExclusive | 0x20 | QPointerEvent::setExclusiveGrabber() 호출 후, 그라버가 nullptr 로 설정된 경우 그랩이 정상적으로 종료되었음을 알리기 위해 발생합니다. |
QPointingDevice::CancelGrabExclusive | 0x30 | 그랩퍼가 다른 객체로 설정된 경우, QPointerEvent::setExclusiveGrabber() 이후에 발생하며, 이전 그랩퍼의 그랩이 "도용"되었음을 알립니다. |
QPointingDevice::GrabPassive | 0x01 | QPointerEvent::addPassiveGrabber() 호출 후 발생합니다. |
QPointingDevice::UngrabPassive | 0x02 | 수동 그랩이 정상적으로 종료될 때(예: QPointerEvent::removePassiveGrabber() 호출 후) 발생합니다. |
QPointingDevice::CancelGrabPassive | 0x03 | 수동 그랩이 비정상적으로 종료될 때(제스처가 취소될 때) 발생합니다. |
QPointingDevice::OverrideGrabPassive | 0x04 | 이 값은 현재 사용되지 않습니다. |
enum class QPointingDevice::PointerType
flags QPointingDevice::PointerTypes
이 열거형은 포인팅 장치와 상호작용하는 대상을 나타냅니다.
이 속성과 ` QInputDevice::DeviceType` 간에는 일부 중복이 있습니다. 예를 들어, 터치스크린을 사용하는 경우 ` DeviceType `는 ` TouchScreen `이고, ` PointerType `는 ` Finger `입니다(항상 그렇습니다). 하지만 그래픽 태블릿에서는 스타일러스의 양쪽 끝을 모두 사용할 수 있는 경우가 많으며, 프로그램은 이를 구분해야 합니다. 따라서 이 개념을 확장하여 모든 ` QPointerEvent `에 `PointerType`을 부여함으로써, `DeviceType`을 무시하고 `PointerType`에 따라 다르게 반응하도록 하여 일부 이벤트 처리 코드를 단순화할 수 있습니다.
유효한 값은 다음과 같습니다:
| 상수 | 값 | 설명 |
|---|---|---|
QPointingDevice::PointerType::Unknown | 0 | 포인터 유형을 알 수 없습니다. |
QPointingDevice::PointerType::Generic | 0x0001 | 마우스 또는 마우스와 유사한 동작을 하는 것(X11의 코어 포인터). |
QPointingDevice::PointerType::Finger | 0x0002 | 사용자의 손가락. |
QPointingDevice::PointerType::Pen | 0x0004 | 스타일러스의 그리기 끝부분. |
QPointingDevice::PointerType::Eraser | 0x0008 | 스타일러스의 반대쪽 끝(반대쪽 끝에 가상 지우개가 있는 경우). |
QPointingDevice::PointerType::Cursor | 0x0010 | Puck 장치에서 볼 수 있는 십자선이 있는 투명한 원. |
QPointingDevice::PointerType::Palm (since Qt 6.12) | 0x0020 | 사용자의 손바닥. |
QPointingDevice::PointerType::AllPointerTypes | 0x7FFF | 위의 항목 중 하나(기본 필터 값으로 사용됨). |
PointerTypes 유형은 QFlags<PointerType>에 대한 typedef입니다. 이 유형은 PointerType 값들의 OR 조합을 저장합니다.
속성 설명
[read-only] buttonCount : const int
이 속성은 감지할 수 있는 기기 내 버튼의 최대 개수를 나타냅니다.
액세스 기능:
| int | buttonCount() const |
[read-only] maximumPoints : const int
이 속성은 감지할 수 있는 최대 동시 터치 지점(손가락) 수를 나타냅니다.
접근 기능:
| int | maximumPoints() const |
[read-only] pointerType : const PointerType
이 속성은 포인터 유형을 저장합니다
액세스 함수:
| QPointingDevice::PointerType | pointerType() const |
[read-only] uniqueId : const QPointingDeviceUniqueId
이 속성은 해당 기기의 고유 ID(실용성은 의문스럽지만)를 포함합니다.
오히려 QPointerEventPoint::uniqueId()에 주목하는 것이 더 나을 것입니다.
액세스 함수:
| QPointingDeviceUniqueId | uniqueId() const |
멤버 함수 설명서
QPointingDevice::QPointingDevice(QObject *parent = nullptr)
parent 의 자식으로 새로운 유효하지 않은 포인팅 장치 인스턴스를 생성합니다.
QPointingDevice::QPointingDevice(const QString &name, qint64 id, QInputDevice::DeviceType deviceType, QPointingDevice::PointerType pointerType, QInputDevice::Capabilities capabilities, int maxPoints, int buttonCount, const QString &seatName = QString(), QPointingDeviceUniqueId uniqueId = QPointingDeviceUniqueId(), QObject *parent = nullptr)
지정된 name, deviceType, pointerType, capabilities, maxPoints, buttonCount, seatName, uniqueId 및 parent 값을 사용하여 새로운 포인팅 장치 인스턴스를 생성합니다.
[protected delete] QPointingDevice::QPointingDevice(const QPointingDevice &)
QPointingDevice 의 인스턴스를 복사 생성합니다. 이 함수는 삭제되었습니다.
[protected delete] QPointingDevice::QPointingDevice(QPointingDevice &&)
QPointingDevice 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.
int QPointingDevice::buttonCount() const
감지할 수 있는 기기 내 버튼의 최대 개수를 반환합니다.
참고: buttonCount 속성에 대한게터 함수입니다.
[signal] void QPointingDevice::grabChanged(QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point) const
이 신호는 grabber 객체가 event 의 전달 과정에서 point 에 대한 배타적 또는 수동적 그랩을 획득하거나 상실할 때 발생합니다. transition 는 grabber 객체의 관점에서 어떤 일이 발생했는지를 알려줍니다.
참고: 한 객체에서 다른 객체로그랩이 전환되면 , 한 객체가 그랩을 잃었음을 알리는 신호와 다른 그랩퍼가 있음을 알리는 신호, 총 두 개의 신호가 발생합니다. 그 외의 경우, 즉 그랩 상태가 아닌 상태로 전환되거나 그 상태로 돌아갈 때는 단 하나의 신호만 발생합니다. 이때 ` grabber ` 인수는 절대 ` nullptr`가 아닙니다.
QPointerEvent::setExclusiveGrabber(), QPointerEvent::addPassiveGrabber(), QPointerEvent::removePassiveGrabber()도 참조하십시오 .
int QPointingDevice::maximumPoints() const
감지할 수 있는 최대 동시 터치 포인트(손가락) 수를 반환합니다.
참고: maximumPoints 속성에 대한게터 함수입니다.
QPointingDevice::PointerType QPointingDevice::pointerType() const
포인터 유형을 반환합니다.
참고: pointerType 속성에 대한게터 함수입니다.
[static] const QPointingDevice *QPointingDevice::primaryPointingDevice(const QString &seatName = QString())
지정된 좌석 seatName 에 대한 주 포인팅 장치(핵심 포인터, 일반적으로 마우스로 간주됨)를 반환합니다.
여러 포인팅 장치가 등록된 경우, 이 함수는 주어진 seatName 과 일치하고 다른 장치를 부모로 두지 않는 마우스나 터치패드를 우선적으로 선택합니다. 일반적으로 부모 장치가 없는 마스터 또는 핵심 장치는 하나뿐입니다. 하지만 이러한 장치를 찾을 수 없는 경우, 이 함수는 새로운 가상 “핵심 포인터” 마우스를 생성합니다. 따라서 Qt는 아직 입력 장치 탐색 및 등록 기능을 지원하지 않는 플랫폼에서도 계속 작동합니다.
QPointingDeviceUniqueId QPointingDevice::uniqueId() const
해당 장치에 대한 고유 ID(실용성은 의문스럽지만)를 반환합니다.
오히려 QPointerEventPoint::uniqueId()에 더 주의를 기울이는 것이 좋습니다.
참고: uniqueId 속성에 대한게터 함수입니다.
[protected delete] QPointingDevice &QPointingDevice::operator=(QPointingDevice &&)
other 를 이 QPointingDevice 인스턴스에 할당합니다. 이 함수는 삭제됩니다.
[protected delete] QPointingDevice &QPointingDevice::operator=(const QPointingDevice &)
other 을 이 QPointingDevice 인스턴스에 복사-할당합니다. 이 함수는 삭제됩니다.
© 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.