QWaylandBufferRef Class
A classe QWaylandBufferRef contém a referência a um buffer de superfície. Mais...
| Cabeçalho: | #include <QWaylandBufferRef> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
Funções públicas
| QWaylandBufferRef() | |
| QWaylandBufferRef(const QWaylandBufferRef &ref) | |
| ~QWaylandBufferRef() | |
| bool | hasBuffer() const |
| bool | hasContent() const |
(since 6.2) bool | hasProtectedContent() const |
| QImage | image() const |
| bool | isDestroyed() const |
| bool | isNull() const |
| bool | isSharedMemory() const |
| quintptr | lockNativeBuffer() |
| QWaylandSurface::Origin | origin() const |
| QSize | size() const |
| QOpenGLTexture * | toOpenGLTexture(int plane = 0) const |
| void | unlockNativeBuffer(quintptr handle) |
| struct wl_resource * | wl_buffer() const |
| QWaylandBufferRef & | operator=(const QWaylandBufferRef &ref) |
Não-membros relacionados
| bool | operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) |
| bool | operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) |
Descrição detalhada
Esta classe pode ser usada para referenciar um buffer de superfície. Enquanto houver uma referência ao buffer, ele pertence ao compositor e o cliente não pode modificá-lo.
Documentação das funções de membro
QWaylandBufferRef::QWaylandBufferRef()
Cria uma referência a um buffer nulo.
QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
Cria uma nova referência ao buffer indicado por ` ref`.
[noexcept] QWaylandBufferRef::~QWaylandBufferRef()
Desreferencia o buffer.
bool QWaylandBufferRef::hasBuffer() const
Retorna `true` se este ` QWaylandBufferRef ` fizer referência a um buffer. Caso contrário, retorna `false`.
Veja também ` isNull()` e ` hasContent()`.
bool QWaylandBufferRef::hasContent() const
Retorna `true` se este ` QWaylandBufferRef ` fizer referência a um buffer que contenha dados. Caso contrário, retorna `false`.
Veja também ` isNull()` e ` hasBuffer()`.
[since 6.2] bool QWaylandBufferRef::hasProtectedContent() const
Retorna `true` se este ` QWaylandBufferRef ` fizer referência a um buffer com conteúdo protegido. Caso contrário, retorna `false`.
Observação: Trata-se de um recurso que pressupõe suporte na integração de buffer do cliente. Atualmente, nenhuma das integrações de buffer do cliente incluídas no Qt oferece suporte a buffers de conteúdo protegido.
Esta função foi introduzida no Qt 6.2.
Veja também ` hasContent()`.
QImage QWaylandBufferRef::image() const
Retorna uma imagem com o conteúdo do buffer.
bool QWaylandBufferRef::isDestroyed() const
Retorna `true` se este ` QWaylandBufferRef ` fizer referência a um buffer que tenha sido destruído. Caso contrário, retorna `false`.
bool QWaylandBufferRef::isNull() const
Retorna `true` se este ` QWaylandBufferRef ` não fizer referência a um buffer. Caso contrário, retorna `false`.
Veja também ` hasBuffer()` e ` hasContent()`.
bool QWaylandBufferRef::isSharedMemory() const
Retorna `true` se o buffer for um buffer de memória compartilhada. Caso contrário, retorna `false`.
quintptr QWaylandBufferRef::lockNativeBuffer()
Retorna o identificador nativo deste buffer e o marca como bloqueado, de modo que ele não será liberado até que a função ` unlockNativeBuffer()` seja chamada.
Retorna 0 se não houver um identificador nativo para este buffer ou se o bloqueio não tiver sido bem-sucedido.
QWaylandSurface::Origin QWaylandBufferRef::origin() const
Retorna a origem do buffer. Se o buffer referenciado for nulo, é retornado ` QWaylandSurface::OriginBottomLeft `.
QSize QWaylandBufferRef::size() const
Retorna o tamanho do buffer. Se o buffer referenciado for nulo, é retornado um QSize() inválido.
QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(int plane = 0) const
Retorna uma textura OpenGL para o buffer. ` plane ` é o índice para formatos multiplano, como YUV.
A textura retornada pertence ao buffer. A textura só é válida enquanto a referência ao buffer existir. O chamador desta função não deve excluir a textura e deve manter uma referência ao buffer enquanto a textura estiver sendo usada.
Retorna ` nullptr ` se não houver um buffer válido ou se não for possível criar uma textura.
void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)
Marca o buffer nativo como não mais em uso. ` handle ` deve corresponder ao valor retornado por uma chamada anterior à função ` lockNativeBuffer()`.
struct wl_resource *QWaylandBufferRef::wl_buffer() const
Retorna o recurso Wayland correspondente ao buffer.
QWaylandBufferRef &QWaylandBufferRef::operator=(const QWaylandBufferRef &ref)
Atribui ` ref ` a este buffer e adiciona uma referência a ele. A referência anterior a este buffer é removida.
Não-membros relacionados
[noexcept] bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Retorna ` false ` se ` lhs ` fizer referência ao mesmo buffer que ` rhs`. Caso contrário, retorna ` true`.
[noexcept] bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Retorna ` true ` se ` lhs ` fizer referência ao mesmo buffer que ` rhs`. Caso contrário, retorna ` false`.
© 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.