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: QWaylandObject
Detailed Description▲
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.
Member Type Documentation▲
enum QWaylandSeat::CapabilityFlag▲
flags QWaylandSeat::CapabilityFlags
This enum type describes the capabilities of a QWaylandSeat.
Constant |
Value |
Description |
---|---|---|
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.
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 *drag() 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 *keymap()
Member Function Documentation▲
QWaylandSeat::QWaylandSeat(QWaylandCompositor *compositor, QWaylandSeat::CapabilityFlags capabilityFlags = DefaultCapabilities)▲
Constructs a QWaylandSeat for the given compositor and capabilityFlags.
[override virtual] QWaylandSeat::~QWaylandSeat()▲
Destroys the QWaylandSeat
QWaylandSeat::CapabilityFlags QWaylandSeat::capabilities() const▲
Returns the capability flags for this QWaylandSeat.
QWaylandCompositor *QWaylandSeat::compositor() const▲
Returns the compositor for this QWaylandSeat.
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 QWaylandSeat.
Getter function for property drag.
[static] QWaylandSeat *QWaylandSeat::fromSeatResource(struct ::wl_resource *resource)▲
Returns the QWaylandSeat 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 QWaylandSeat 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▲
void QWaylandSeat::keyboardFocusChanged(QWaylandSurface *newFocus, QWaylandSurface *oldFocus)▲
This signal is emitted when setKeyboardFocus() 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 QWaylandSeat.
Getter function for property keymap.
QWaylandView *QWaylandSeat::mouseFocus() const▲
void QWaylandSeat::mouseFocusChanged(QWaylandView *newFocus, QWaylandView *oldFocus)▲
This signal is emitted when the mouse focus has changed from oldFocus to newFocus.