QWaylandQuickItem Class

The QWaylandQuickItem class provides a Qt Quick item representing a QWaylandView. More...

Header: #include <QWaylandQuickItem>
qmake: QT += waylandcompositor
Since: Qt 5.8
Inherits: QQuickItem
Inherited By:

QWaylandQuickShellSurfaceItem

Properties

Public Functions

QWaylandQuickItem(QQuickItem *parent = nullptr)
virtual ~QWaylandQuickItem() override
bool allowDiscardFrontBuffer() const
QWaylandCompositor *compositor() const
bool focusOnClick() const
bool inputEventsEnabled() const
QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const
bool inputRegionContains(const QPointF &localPosition) const
bool inputRegionContains(const QPointF &localPosition)
bool isBufferLocked() const
QPointF mapToSurface(const QPointF &point) const
QWaylandSurface::Origin origin() const
QWaylandOutput *output() const
bool paintEnabled() const
void setAllowDiscardFrontBuffer(bool discard)
void setBufferLocked(bool locked)
void setFocusOnClick(bool focus)
void setInputEventsEnabled(bool enabled)
void setOutput(QWaylandOutput *output)
void setPrimary()
void setSizeFollowsSurface(bool sizeFollowsSurface)
void setSubsurfaceHandler(QObject *)
void setSurface(QWaylandSurface *surface)
void setTouchEventsEnabled(bool enabled)
bool sizeFollowsSurface() const
QObject *subsurfaceHandler() const
QWaylandSurface *surface() const
bool touchEventsEnabled() const
QWaylandView *view() const

Reimplemented Public Functions

virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
virtual bool isTextureProvider() const override
virtual QSGTextureProvider *textureProvider() const override

Public Slots

void lower()
void raise()
void sendMouseMoveEvent(const QPointF &position, QWaylandSeat *seat = nullptr)
void setPaintEnabled(bool paintEnabled)
virtual void takeFocus(QWaylandSeat *device = nullptr)

Signals

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Reimplemented Protected Functions

virtual void touchUngrabEvent() override
virtual QSGNode *updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data) override
  • 33 protected functions inherited from QQuickItem
  • 9 protected functions inherited from QObject

Detailed Description

The QWaylandQuickItem class provides a Qt Quick item representing a QWaylandView.

When writing a QWaylandCompositor in Qt Quick, this class can be used to display a client's contents on an output device and will pass user input to the client.

Property Documentation

allowDiscardFrontBuffer : bool

By default, the item locks the current buffer until a new buffer is available and updatePaintNode() is called. Set this property to true to allow Qt to release the buffer immediately when the throttling view is no longer using it. This is useful for items that have slow update intervals.

Access functions:

bool allowDiscardFrontBuffer() const
void setAllowDiscardFrontBuffer(bool discard)

Notifier signal:

void allowDiscardFrontBufferChanged()

bufferLocked : bool

Access functions:

bool isBufferLocked() const
void setBufferLocked(bool locked)

Notifier signal:

void bufferLockedChanged()

compositor : QWaylandCompositor* const

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

Access functions:

QWaylandCompositor *compositor() const

focusOnClick : bool

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

The default is true.

Access functions:

bool focusOnClick() const
void setFocusOnClick(bool focus)

Notifier signal:

void focusOnClickChanged()

inputEventsEnabled : bool

Access functions:

bool inputEventsEnabled() const
void setInputEventsEnabled(bool enabled)

Notifier signal:

void inputEventsEnabledChanged()

origin : const QWaylandSurface::Origin

This property holds the origin of the QWaylandQuickItem.

Access functions:

QWaylandSurface::Origin origin() const

Notifier signal:

void originChanged()

output : QWaylandOutput*

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

Access functions:

QWaylandOutput *output() const
void setOutput(QWaylandOutput *output)

Notifier signal:

void outputChanged()

paintEnabled : bool

Access functions:

bool paintEnabled() const
void setPaintEnabled(bool paintEnabled)

sizeFollowsSurface : bool

This property specifies whether the size of the item should always match the size of its surface.

The default is true.

Access functions:

bool sizeFollowsSurface() const
void setSizeFollowsSurface(bool sizeFollowsSurface)

Notifier signal:

void sizeFollowsSurfaceChanged()

subsurfaceHandler : QObject*

Access functions:

QObject *subsurfaceHandler() const
void setSubsurfaceHandler(QObject *)

Notifier signal:

void subsurfaceHandlerChanged()

surface : QWaylandSurface*

This property holds the surface rendered by this QWaylandQuickItem.

Access functions:

QWaylandSurface *surface() const
void setSurface(QWaylandSurface *surface)

Notifier signal:

void surfaceChanged()

touchEventsEnabled : bool

Access functions:

bool touchEventsEnabled() const
void setTouchEventsEnabled(bool enabled)

Notifier signal:

void touchEventsEnabledChanged()

Member Function Documentation

QWaylandQuickItem::QWaylandQuickItem(QQuickItem *parent = nullptr)

Constructs a QWaylandQuickItem with the given parent.

[override virtual] QWaylandQuickItem::~QWaylandQuickItem()

Destroy the QWaylandQuickItem.

[override virtual] QVariant QWaylandQuickItem::inputMethodQuery(Qt::InputMethodQuery query) const

QVariant QWaylandQuickItem::inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition) const

Returns true if the input region of this item's surface contains the position given by localPosition.

bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition)

Returns true if the input region of this item's surface contains the position given by localPosition.

[override virtual] bool QWaylandQuickItem::isTextureProvider() const

[slot] void QWaylandQuickItem::lower()

QPointF QWaylandQuickItem::mapToSurface(const QPointF &point) const

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.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[signal] void QWaylandQuickItem::mouseMove(const QPointF &windowPosition)

[signal] void QWaylandQuickItem::mouseRelease()

bool QWaylandQuickItem::paintEnabled() const

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.

Note: Getter function for property paintEnabled.

See also setPaintEnabled().

[slot] void QWaylandQuickItem::raise()

[slot] void QWaylandQuickItem::sendMouseMoveEvent(const QPointF &position, QWaylandSeat *seat = nullptr)

void QWaylandQuickItem::setPrimary()

Makes this QWaylandQuickItem's view the primary view for the surface.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

See also QWaylandSurface::primaryView.

[signal] void QWaylandQuickItem::surfaceDestroyed()

This signal is emitted when the client has destroyed the wl_surface associated with the QWaylandQuickItem. The handler for this signal is expected to either destroy the QWaylandQuickItem 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

See also QWaylandQuickkItem::bufferLocked.

[virtual slot] void QWaylandQuickItem::takeFocus(QWaylandSeat *device = nullptr)

Calling this function causes the item to take the focus of the input device.

[override virtual] QSGTextureProvider *QWaylandQuickItem::textureProvider() const

Reimplemented from QQuickItem::textureProvider().

Returns the texture provider of this QWaylandQuickItem.

[override virtual protected] void QWaylandQuickItem::touchUngrabEvent()

[override virtual protected] QSGNode *QWaylandQuickItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)

QWaylandView *QWaylandQuickItem::view() const

Returns the view rendered by this QWaylandQuickItem.

© 2019 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.