QWaylandView Class
La clase QWaylandView representa una vista de una superficie en una salida. Más...
| Cabecera: | #include <QWaylandView> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| En QML: | WaylandView |
| Hereda: | QObject |
Propiedades
- allowDiscardFrontBuffer : bool
- bufferLocked : bool
- output : QWaylandOutput*
- surface : QWaylandSurface*
Funciones públicas
| QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr) | |
| virtual | ~QWaylandView() override |
| virtual bool | advance() |
| bool | allowDiscardFrontBuffer() const |
| virtual void | bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage) |
| virtual QWaylandBufferRef | currentBuffer() |
| virtual QRegion | currentDamage() |
| virtual void | discardCurrentBuffer() |
| bool | isBufferLocked() const |
| bool | isPrimary() const |
| QWaylandOutput * | output() const |
| QObject * | renderObject() const |
| void | setAllowDiscardFrontBuffer(bool discard) |
| void | setBufferLocked(bool locked) |
| void | setOutput(QWaylandOutput *output) |
| void | setPrimary() |
| void | setSurface(QWaylandSurface *surface) |
| QWaylandSurface * | surface() const |
| struct wl_resource * | surfaceResource() const |
Señales
| void | allowDiscardFrontBufferChanged() |
| void | bufferLockedChanged() |
| void | outputChanged() |
| void | surfaceChanged() |
Descripción Detallada
La QWaylandView corresponde a la presentación de una superficie en una salida específica, gestionando los buffers que contienen los contenidos a renderizar. Se pueden tener varias vistas en una misma superficie.
Documentación de Propiedades
allowDiscardFrontBuffer : bool
Por defecto, la vista bloquea el buffer actual hasta que se llama a advance(). Establece esta propiedad a true para permitir que Qt libere el buffer cuando la vista primaria ya no lo esté utilizando.
Esto puede usarse para evitar la situación en la que una vista secundaria que se actualiza con una frecuencia menor estrangulará la velocidad de fotogramas de la aplicación cliente.
Funciones de acceso:
| bool | allowDiscardFrontBuffer() const |
| void | setAllowDiscardFrontBuffer(bool discard) |
Señal notificadora:
| void | allowDiscardFrontBufferChanged() |
bufferLocked : bool
Esta propiedad indica si el búfer de la vista está bloqueado. Cuando el buffer está bloqueado, advance() no avanzará al siguiente buffer y devuelve false.
El valor por defecto es false.
Funciones de acceso:
| bool | isBufferLocked() const |
| void | setBufferLocked(bool locked) |
Señal de notificador:
| void | bufferLockedChanged() |
output : QWaylandOutput*
Esta propiedad contiene la salida en la que esta vista muestra su superficie.
Funciones de acceso:
| QWaylandOutput * | output() const |
| void | setOutput(QWaylandOutput *output) |
Señal del notificador:
| void | outputChanged() |
surface : QWaylandSurface*
Esta propiedad contiene la superficie vista por este QWaylandView.
Funciones de acceso:
| QWaylandSurface * | surface() const |
| void | setSurface(QWaylandSurface *surface) |
Señal del notificador:
| void | surfaceChanged() |
Documentación de la función miembro
QWaylandView::QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr)
Construye un QWaylandView con los datos renderObject y parent.
[override virtual noexcept] QWaylandView::~QWaylandView()
Destruye el QWaylandView.
[virtual] bool QWaylandView::advance()
Actualiza la memoria intermedia actual y la región dañada a la última versión confirmada por el cliente. Devuelve true si se ha enviado nuevo contenido desde la última llamada a advance(). En caso contrario, devuelve false.
Véase también currentBuffer() y currentDamage().
[virtual] void QWaylandView::bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage)
Esta función es llamada cuando un nuevo buffer es enviado a la superficie de esta vista. damage contiene la región que es diferente del buffer actual, es decir, la región que necesita ser actualizada. El nuevo buffer se convertirá en actual en la siguiente llamada a advance().
Las subclases que reimplementen esta función deben llamar a la implementación base.
[virtual] QWaylandBufferRef QWaylandView::currentBuffer()
Devuelve una referencia al búfer actual de esta vista.
[virtual] QRegion QWaylandView::currentDamage()
Devuelve la región de daños actual de esta vista.
[virtual] void QWaylandView::discardCurrentBuffer()
Fuerza a la vista a descartar su búfer actual, para permitir su reutilización en el lado del cliente.
bool QWaylandView::isPrimary() const
Devuelve true si este QWaylandView es la vista primaria para el QWaylandSurface
Véase también QWaylandSurface::primaryView.
void QWaylandView::setPrimary()
Hace que este QWaylandView sea la vista principal de la superficie.
No tiene efecto si este QWaylandView no tiene ninguna QWaylandSurface
Véase también isPrimary() y QWaylandSurface::primaryView.
struct wl_resource *QWaylandView::surfaceResource() const
Devuelve el recurso de superficie Wayland para este QWaylandView.
© 2026 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.