IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWaylandSeat Class

The https:// class provides access to keyboard, mouse, and touch input.

This class was introduced in Qt 5.8.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWaylandSeat Class▲

  • Header: QWaylandSeat

  • Since: Qt 5.8

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Waylandcompositor)

    target_link_libraries(mytarget PRIVATE Qt6::Waylandcompositor)

  • qmake: QT += waylandcompositor

  • Inherited By:

  • Instantiated By: qml-qtwayland-compositor-waylandseat.xml

  • Inherits: https://

Detailed Description▲

The https:// 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.

Member Type Documentation▲

 

enum QWaylandSeat::CapabilityFlag▲

flags QWaylandSeat::CapabilityFlags

This enum type describes the capabilities of a https://.

Constant

Value

Description

https://::Pointer

0x01

The https:// supports pointer input.

https://::Keyboard

0x02

The https:// supports keyboard input.

https://::Touch

0x04

The https:// supports touch input.

https://::DefaultCapabilities

Pointer | Keyboard | Touch

The https:// has the default capabilities.

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

Property Documentation▲

 

[read-only] drag : QWaylandDrag* const▲

This property holds the drag and drop operations and sends signals when they start and end. The property stores details like what image should be under the mouse cursor when the user drags it.

Access functions:

  • QWaylandDrag *https://() const

[read-only] keymap : QWaylandKeymap* const▲

This property holds the keymap object.

A keymap provides a way to translate actual key scan codes into a meaningful value. For example, if you use a keymap with a Norwegian layout, the key to the right of the letter L produces an Ø.

Keymaps can also be used to customize key functions, such as to specify whether Control and CAPS lock should be swapped, and so on.

Access functions:

  • QWaylandKeymap *https://()

Member Function Documentation▲

 

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

Constructs a https:// for the given compositor and capabilityFlags.

[override virtual] QWaylandSeat::~QWaylandSeat()▲

Destroys the https://

QWaylandSeat::CapabilityFlags QWaylandSeat::capabilities() const▲

Returns the capability flags for this https://.

QWaylandCompositor *QWaylandSeat::compositor() const▲

Returns the compositor for this https://.

void QWaylandSeat::cursorSurfaceRequest(QWaylandSurface *surface, int hotspotX, int hotspotY)▲

This signal is emitted when the client has requested for a specific surface to be the mouse cursor. For example, when the user hovers over a particular surface, and you want the cursor to change into a resize arrow.

Both hotspotX and hotspotY are offsets from the top-left of a pointer surface, where a click should happen. For example, if the requested cursor surface is an arrow, the parameters indicate where the arrow's tip is, on that surface.

QWaylandDrag *QWaylandSeat::drag() const▲

Returns the drag object for this https://.

Getter function for property https://.

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

Returns the https:// corresponding to the resource. The resource is expected to have the type wl_seat.

[virtual] void QWaylandSeat::initialize()▲

Initializes parts of the seat corresponding to the capabilities set in the constructor, or through setCapabilities().

Normally, this function is called automatically after the seat and compositor have been created, so calling it manually is usually unnecessary.

bool QWaylandSeat::isInitialized() const▲

Returns true if the https:// is initialized; false otherwise.

The value true indicates that it's now possible for clients to start using the seat.

QWaylandKeyboard *QWaylandSeat::keyboard() const▲

Returns the keyboard for this input device.

QWaylandSurface *QWaylandSeat::keyboardFocus() const▲

Returns the current focused surface for keyboard input.

See Also▲

See also https://()

void QWaylandSeat::keyboardFocusChanged(QWaylandSurface *newFocus, QWaylandSurface *oldFocus)▲

This signal is emitted when https://() is called.

newFocus has the surface that received keyboard focus; or nullptr if no surface has focus. oldFocus has the surface that lost keyboard focus; or nullptr if no surface had focus.

QWaylandKeymap *QWaylandSeat::keymap()▲

Returns the keymap object for this https://.

Getter function for property https://.

QWaylandView *QWaylandSeat::mouseFocus() const▲

Returns the view that currently has mouse focus.

See Also▲

See also https://()

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 https://.

void QWaylandSeat::sendFullKeyEvent(QKeyEvent *event)▲

Sends the event to the keyboard device.

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

Sends the event to the specified surface on the touch device.

This API will automatically map https://() to a sequential id before sending it to the client. It should therefore not be used in combination with the other API using explicit ids, as collisions might occur.

[since 5.12] void QWaylandSeat::sendKeyEvent(int qtKey, bool pressed)▲

Sends a key press (if pressed is true) or release (if pressed is false) event of a key qtKey to the keyboard device.

This function was introduced in Qt 5.12.

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 to the https://'s pointer device.

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

Sends a mouse release event for button to the https://'s pointer device.

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

Sends a mouse wheel event to the https://'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.

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.

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.

This API should not be used in combination with forwarding of touch events using QWaylandQuickItem::touchEventsEnabled or https://, as it might lead to conflicting touch ids.

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.

This API should not be used in combination with forwarding of touch events using QWaylandQuickItem::touchEventsEnabled or https://, as it might lead to conflicting touch ids.

Returns the serial for the touch motion event.

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.

This API should not be used in combination with forwarding of touch events using QWaylandQuickItem::touchEventsEnabled or https://, as it might lead to conflicting touch ids.

Returns the serial for the touch down event.

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.

This API should not be used in combination with forwarding of touch events using QWaylandQuickItem::touchEventsEnabled or https://, as it might lead to conflicting touch ids.

Returns the serial for the touch up event.

bool QWaylandSeat::setKeyboardFocus(QWaylandSurface *surface)▲

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

See Also▲

See also https://()

void QWaylandSeat::setMouseFocus(QWaylandView *view)▲

Sets the current mouse focus to view.

See Also▲

See also https://()

QWaylandTouch *QWaylandSeat::touch() const▲

Returns the touch device for this https://.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.