- Qt 6.6
- Qt Wayland Compositor
- QML Types
- WaylandQuickItem
- Qt Wayland Compositor | Commercial or GPLv3

# WaylandQuickItem QML Type

Provides a Qt Quick item that represents a WaylandView. More...

Import Statement: | import QtWayland.Compositor 1.6
Instantiates: | QWaylandQuickItem
Inherited By: | ShellSurfaceItem

- List of all members, including inherited members

## Properties

- bufferLocked : bool
- compositor : WaylandCompositor
- focusOnClick : bool
- origin : enum
- output : WaylandOutput
- paintEnabled : bool
- subsurfaceHandler : object
- surface : WaylandSurface
- touchEventsEnabled : bool

## Signals

- void surfaceDestroyed()

## Methods

- point mapFromSurface(point point)
- point mapToSurface(point point)
- setPrimary()

## Detailed Description

Qt Quick-based Wayland compositors can use this type to display a client's contents on an output device. It passes user input to the client.

## Property Documentation

bufferLocked : bool

This property holds whether the item's buffer is currently locked. As long as the buffer is locked, it will not be released and returned to the client.

The default is false.

[read-only] compositor : WaylandCompositor

This property holds the compositor for the surface rendered by this WaylandQuickItem.

focusOnClick : bool

This property specifies whether the WaylandQuickItem should take focus when it is clicked or touched.

The default is `true`.

[read-only] origin : enum

This property holds the origin of the QWaylandQuickItem.

output : WaylandOutput

This property holds the output on which this item is displayed.

paintEnabled : bool

Returns true if the item is hidden, though the texture is still updated. As opposed to hiding the item by setting visible to `false`, setting this property to `false` will not prevent mouse or keyboard input from reaching item.

subsurfaceHandler : object

This property provides a way to override the default subsurface behavior.

By default, Qt will create a new SurfaceItem as a child of this item, and maintain the correct position.

To override the default, assign a handler object to this property. The handler should implement a handleSubsurfaceAdded(WaylandSurface) function.

     ShellSurfaceItem {
         subsurfaceHandler: QtObject {
             function handleSubsurfaceAdded(child) {
               // create custom surface item, and connect the subsurfacePositionChanged signal
             }
         }
     }

The default value of this property is `null`.

surface : WaylandSurface

This property holds the surface rendered by this WaylandQuickItem.

touchEventsEnabled : bool

This property holds `true` if touch events are forwarded to the client surface, `false` otherwise.

## Signal Documentation

void surfaceDestroyed()

This signal is emitted when the client has destroyed the `wl_surface` associated with the WaylandQuickItem. The handler for this signal is expected to either destroy the WaylandQuickItem immediately or start a close animation and then destroy the Item.

If an animation is started, bufferLocked should be set to ensure the item keeps its content until the animation finishes

Note: The corresponding handler is `onSurfaceDestroyed`.

See also bufferLocked.

## Method Documentation

point mapFromSurface(point point)

Maps the given point in the Wayland surfaces's coordinate system to the equivalent point within this item's coordinate system, and returns the mapped coordinate.

point mapToSurface(point point)

Maps the given point in this item's coordinate system to the equivalent point within the Wayland surface's coordinate system, and returns the mapped coordinate.

setPrimary()

Makes this WaylandQuickItem the primary view for the surface.