QWaylandView Class
La clase QWaylandView representa una vista de una superficie en una salida. Más información...
| Encabezado: | #include <QWaylandView> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| Heredado de: | 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 |
| 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
QWaylandView se encarga de la presentación de una superficie en una salida específica, gestionando los búferes que contienen el contenido que se va a renderizar. Se pueden tener varias vistas en la misma superficie.
Documentación de propiedades
allowDiscardFrontBuffer : bool
De forma predeterminada, la vista bloquea el búfer actual hasta que se llama a ` advance()`. Establece esta propiedad en ` true ` para permitir que Qt libere el búfer cuando la vista principal ya no lo esté utilizando.
Esto puede utilizarse para evitar que una vista secundaria, que se actualiza con menor frecuencia, limite la tasa de fotogramas de la aplicación cliente.
Funciones de acceso:
| bool | allowDiscardFrontBuffer() const |
| void | setAllowDiscardFrontBuffer(bool discard) |
Señal de notificación:
| void | allowDiscardFrontBufferChanged() |
bufferLocked : bool
Esta propiedad indica si el búfer de la vista está bloqueado en ese momento. Cuando el búfer está bloqueado, la función ` advance()` no pasa al siguiente búfer 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 de notificación:
| void | outputChanged() |
surface : QWaylandSurface*
Esta propiedad contiene la superficie que se ve en este enlace: QWaylandView.
Funciones de acceso:
| QWaylandSurface * | surface() const |
| void | setSurface(QWaylandSurface *surface) |
Señal de notificación:
| void | surfaceChanged() |
Documentación de las funciones de miembro
QWaylandView::QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr)
Crea un objeto `QWaylandView` con los valores proporcionados en ` renderObject ` y ` parent`.
[override virtual noexcept] QWaylandView::~QWaylandView()
Destruye el « QWaylandView ».
[virtual] bool QWaylandView::advance()
Actualiza el búfer actual y la región de daño a la última versión confirmada por el cliente. Devuelve «true» si se ha confirmado 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 se invoca cuando se confirma un nuevo « buffer » en la superficie de esta vista. « damage » contiene la región que difiere del «buffer» actual, es decir, la región que debe actualizarse. El nuevo « buffer » pasará a ser el 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ño actual de esta vista.
[virtual] void QWaylandView::discardCurrentBuffer()
Obliga a la vista a borrar su búfer actual, para que pueda reutilizarse en el lado del cliente.
bool QWaylandView::isPrimary() const
Devuelve «true» si este QWaylandView es la vista principal de la QWaylandSurface
Véase también QWaylandSurface::primaryView.
void QWaylandView::setPrimary()
Establece este QWaylandView como vista principal de la superficie.
No tiene ningún efecto si este QWaylandView no contiene ningún QWaylandSurface
Véase también ` isPrimary()` y ` QWaylandSurface::primaryView`.
struct wl_resource *QWaylandView::surfaceResource() const
Devuelve el recurso de superficie de Wayland correspondiente a 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.