QWaylandSeat Class

The QWaylandSeat class provides access to keyboard, mouse, and touch input. 更多...

头: #include <QWaylandSeat>
qmake: QT += waylandcompositor
Since: Qt 5.8
继承: QWaylandObject

公共类型

enum CapabilityFlag { Pointer, Keyboard, Touch, DefaultCapabilities }
flags CapabilityFlags

特性

公共函数

QWaylandSeat (QWaylandCompositor * compositor , QWaylandSeat::CapabilityFlags capabilityFlags = DefaultCapabilities)
virtual ~QWaylandSeat () override
QWaylandSeat::CapabilityFlags capabilities () const
QWaylandCompositor * compositor () const
QWaylandDrag * drag () const
virtual void initialize ()
bool isInitialized () const
QWaylandKeyboard * keyboard () const
QWaylandSurface * keyboardFocus () const
QWaylandKeymap * keymap ()
QWaylandView * mouseFocus () const
QWaylandPointer * pointer () const
void sendFullKeyEvent (QKeyEvent * event )
void sendFullTouchEvent (QWaylandSurface * surface , QTouchEvent * event )
void sendKeyEvent (int qtKey , bool pressed )
void sendKeyPressEvent (uint code )
void sendKeyReleaseEvent (uint code )
void sendMouseMoveEvent (QWaylandView * view , const QPointF & localPos , const QPointF & outputSpacePos = QPointF())
void sendMousePressEvent (Qt::MouseButton button )
void sendMouseReleaseEvent (Qt::MouseButton button )
void sendMouseWheelEvent (Qt::Orientation orientation , int delta )
void sendTouchCancelEvent (QWaylandClient * client )
void sendTouchFrameEvent (QWaylandClient * client )
uint sendTouchPointEvent (QWaylandSurface * surface , int id , const QPointF & point , Qt::TouchPointState state )
uint sendTouchPointMoved (QWaylandSurface * surface , int id , const QPointF & position )
uint sendTouchPointPressed (QWaylandSurface * surface , int id , const QPointF & position )
uint sendTouchPointReleased (QWaylandSurface * surface , int id , const QPointF & position )
bool setKeyboardFocus (QWaylandSurface * surface )
void setMouseFocus (QWaylandView * view )
QWaylandTouch * touch () const

信号

void cursorSurfaceRequest (QWaylandSurface * surface , int hotspotX , int hotspotY )
void keyboardFocusChanged (QWaylandSurface * newFocus , QWaylandSurface * oldFocus )
void mouseFocusChanged (QWaylandView * newFocus , QWaylandView * oldFocus )

静态公共成员

QWaylandSeat * fromSeatResource (struct ::wl_resource * resource )
const QMetaObject staticMetaObject

额外继承成员

详细描述

The QWaylandSeat class provides access to keyboard, mouse, and touch input.

The QWaylandSeat provides access to different types of user input and maintains a keyboard focus and a mouse pointer. It corresponds to the wl_seat interface in the Wayland protocol.

成员类型文档编制

enum QWaylandSeat:: CapabilityFlag
flags QWaylandSeat:: CapabilityFlags

This enum type describes the capabilities of a QWaylandSeat .

常量 描述
QWaylandSeat::Pointer 0x01 The QWaylandSeat supports pointer input.
QWaylandSeat::Keyboard 0x02 The QWaylandSeat supports keyboard input.
QWaylandSeat::Touch 0x04 The QWaylandSeat supports touch input.
QWaylandSeat::DefaultCapabilities Pointer | Keyboard | Touch The QWaylandSeat has the default capabilities.

The CapabilityFlags type is a typedef for QFlags <CapabilityFlag>. It stores an OR combination of CapabilityFlag values.

特性文档编制

drag : QWaylandDrag * const

访问函数:

QWaylandDrag * drag () const

keymap : QWaylandKeymap * const

访问函数:

QWaylandKeymap * keymap ()

成员函数文档编制

QWaylandSeat:: QWaylandSeat ( QWaylandCompositor * compositor , QWaylandSeat::CapabilityFlags capabilityFlags = DefaultCapabilities)

构造 QWaylandSeat 为给定 compositor and with the given capabilityFlags .

[override virtual] QWaylandSeat:: ~QWaylandSeat ()

销毁 QWaylandSeat

QWaylandSeat::CapabilityFlags QWaylandSeat:: capabilities () const

Returns the capability flags for this QWaylandSeat .

QWaylandCompositor *QWaylandSeat:: compositor () const

Returns the compositor for this QWaylandSeat .

[signal] void QWaylandSeat:: cursorSurfaceRequest ( QWaylandSurface * surface , int hotspotX , int hotspotY )

QWaylandDrag *QWaylandSeat:: drag () const

Returns the drag object for this QWaylandSeat .

注意: getter 函数对于特性 drag .

[static] QWaylandSeat *QWaylandSeat:: fromSeatResource ( struct ::wl_resource * resource )

返回 QWaylandSeat corresponding to the resource resource is expected to have the type wl_seat.

[虚拟] void QWaylandSeat:: initialize ()

bool QWaylandSeat:: isInitialized () const

QWaylandKeyboard *QWaylandSeat:: keyboard () const

Returns the keyboard for this input device.

QWaylandSurface *QWaylandSeat:: keyboardFocus () const

Returns the current focused surface for keyboard input.

另请参阅 setKeyboardFocus ().

[signal] void QWaylandSeat:: keyboardFocusChanged ( QWaylandSurface * newFocus , QWaylandSurface * oldFocus )

QWaylandView *QWaylandSeat:: mouseFocus () const

Returns the view that currently has mouse focus.

另请参阅 setMouseFocus ().

[signal] void QWaylandSeat:: mouseFocusChanged ( QWaylandView * newFocus , QWaylandView * oldFocus )

This signal is emitted when the mouse focus has changed from oldFocus to newFocus .

QWaylandPointer *QWaylandSeat:: pointer () const

Returns the pointer device for this QWaylandSeat .

void QWaylandSeat:: sendFullKeyEvent ( QKeyEvent * event )

发送 event to the keyboard device.

void QWaylandSeat:: sendFullTouchEvent ( QWaylandSurface * surface , QTouchEvent * event )

发送 event 到指定 surface on the touch device.

void QWaylandSeat:: sendKeyEvent ( int qtKey , bool pressed )

Sends a key press or release to the keyboard device.

该函数在 Qt 5.12 引入。

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QWaylandSeat:: sendKeyPressEvent ( uint code )

Sends a key press event with the key code to the keyboard device.

void QWaylandSeat:: sendKeyReleaseEvent ( uint code )

Sends a key release event with the key code to the keyboard device.

void QWaylandSeat:: sendMouseMoveEvent ( QWaylandView * view , const QPointF & localPos , const QPointF & outputSpacePos = QPointF())

Sets the mouse focus to view and sends a mouse move event to the pointer device with the local position localPos and output space position outputSpacePos .

void QWaylandSeat:: sendMousePressEvent ( Qt::MouseButton button )

Sends a mouse press event for button QWaylandSeat 's pointer device.

void QWaylandSeat:: sendMouseReleaseEvent ( Qt::MouseButton button )

Sends a mouse release event for button QWaylandSeat 's pointer device.

void QWaylandSeat:: sendMouseWheelEvent ( Qt::Orientation orientation , int delta )

Sends a mouse wheel event to the QWaylandSeat 's pointer device with the given orientation and delta .

void QWaylandSeat:: sendTouchCancelEvent ( QWaylandClient * client )

Sends a cancel event to the touch device of a client .

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QWaylandSeat:: sendTouchFrameEvent ( QWaylandClient * client )

Sends a frame event to the touch device of a client to indicate the end of a series of touch up, down, and motion events.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

uint QWaylandSeat:: sendTouchPointEvent ( QWaylandSurface * surface , int id , const QPointF & point , Qt::TouchPointState state )

Sends a touch point event to the surface on a touch device with the given id , point and state .

Returns the serial for the touch up or touch down event.

uint QWaylandSeat:: sendTouchPointMoved ( QWaylandSurface * surface , int id , const QPointF & position )

Sends a touch moved event for the touch point id on surface with position position .

注意: You need to send a touch frame event when you are done sending touch events.

Returns the serial for the touch motion event.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

uint QWaylandSeat:: sendTouchPointPressed ( QWaylandSurface * surface , int id , const QPointF & position )

Sends a touch pressed event for the touch point id on surface with position position .

注意: You need to send a touch frame event when you are done sending touch events.

Returns the serial for the touch down event.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

uint QWaylandSeat:: sendTouchPointReleased ( QWaylandSurface * surface , int id , const QPointF & position )

Sends a touch released event for the touch point id on surface with position position .

注意: You need to send a touch frame event when you are done sending touch events.

Returns the serial for the touch up event.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

bool QWaylandSeat:: setKeyboardFocus ( QWaylandSurface * surface )

Sets the current keyboard focus to surface . Returns a boolean indicating if the operation was successful.

另请参阅 keyboardFocus ().

void QWaylandSeat:: setMouseFocus ( QWaylandView * view )

Sets the current mouse focus to view .

另请参阅 mouseFocus ().

QWaylandTouch *QWaylandSeat:: touch () const

Returns the touch device for this QWaylandSeat .