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 |
공용 함수
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 |
Signals
void | grabChanged(QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point) const |
정적 공용 멤버
const QPointingDevice * | primaryPointingDevice(const QString &seatName = QString()) |
상세 설명
각 QPointerEvent 에는 유형 및 기능과 같은 장치별 프로퍼티에 액세스할 수 있는 QPointingDevice 포인터가 포함되어 있습니다. 포인터 이벤트를 생성하기 전에 사용 가능한 포인팅 장치를 QWindowSystemInterface를 통해 등록하는 것은 플랫폼 또는 일반 플러그인의 책임입니다. 애플리케이션은 이 클래스를 인스턴스화할 필요가 없으며 QPointerEvent::device()가 가리키는 전역 인스턴스에 액세스하기만 하면 됩니다.
멤버 유형 문서
enum QPointingDevice::GrabTransition
이 열거형은 한 객체(아마도 nullptr
)에서 다른 객체(아마도 nullptr
)로의 독점적 또는 수동적 잡기의 전환을 나타냅니다. QPointingDevice::grabChanged () 신호의 인자로 전달됩니다.
유효한 값은 다음과 같습니다:
Constant | Value | 설명 |
---|---|---|
QPointingDevice::GrabExclusive | 0x10 | QPointerEvent::setExclusiveGrabber() 다음에 발생합니다. |
QPointingDevice::UngrabExclusive | 0x20 | 그래버가 nullptr 로 설정된 경우 QPointerEvent::setExclusiveGrabber() 다음에 발생하여 그래버가 정상적으로 종료되었음을 알립니다. |
QPointingDevice::CancelGrabExclusive | 0x30 | 그래버가 다른 객체로 설정된 경우 QPointerEvent::setExclusiveGrabber() 다음에 발생하여 이전 그래버의 그래브가 "도난당했다"는 것을 알립니다. |
QPointingDevice::GrabPassive | 0x01 | QPointerEvent::addPassiveGrabber() 다음에 발생합니다. |
QPointingDevice::UngrabPassive | 0x02 | 패시브 그래브가 정상적으로 종료될 때, 예를 들어 QPointerEvent::removePassiveGrabber() 다음에 발생하는 이벤트입니다. |
QPointingDevice::CancelGrabPassive | 0x03 | 패시브 그래브가 비정상적으로 종료될 때(제스처가 취소됨) 발생합니다. |
QPointingDevice::OverrideGrabPassive | 0x04 | 이 값은 현재 사용되지 않습니다. |
열거형 클래스 QPointingDevice::PointerType
플래그 QPointingDevice::PointerTypes
이 열거형은 포인팅 장치와 상호 작용하는 것을 나타냅니다.
이 프로퍼티와 QInputDevice::DeviceType 사이에는 약간의 중복성이 있습니다. 예를 들어 터치스크린을 사용하는 경우 DeviceType
은 TouchScreen
이고 PointerType
은 Finger
입니다(항상). 그러나 그래픽 태블릿에서는 스타일러스의 양쪽 끝을 모두 사용할 수 있는 경우가 많으며 프로그램에서 이를 구분해야 합니다. 따라서 이 개념을 확장하여 모든 QPointerEvent 에는 PointerType이 있으며, 일부 이벤트 처리 코드를 단순화하여 DeviceType을 무시하고 PointerType에만 다르게 반응하도록 할 수 있습니다.
유효한 값은 다음과 같습니다:
Constant | Value | 설명 |
---|---|---|
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::AllPointerTypes | 0x7FFF | 위 항목 중 하나(기본 필터 값으로 사용됨). |
PointerTypes 유형은 QFlags<PointerType>에 대한 typedef입니다. PointerType 값의 OR 조합을 저장합니다.
멤버 함수 문서
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 로 새 포인팅 디바이스 인스턴스를 생성합니다.
int QPointingDevice::buttonCount() const
감지할 수 있는 장치 내 버튼의 최대 개수를 반환합니다.
참고: 버튼 카운트 속성에 대한 게터 함수입니다.
[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
감지할 수 있는 최대 동시 터치 포인트(손가락) 수를 반환합니다.
참고: 최대 포인트 프로퍼티에 대한 게터 함수입니다.
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()에 더 신경을 써야 할 것입니다.
참고: 고유 ID 프로퍼티에 대한 게터 함수입니다.
© 2025 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.