QWaylandView Class
QWaylandView 类表示输出上的曲面视图。更多
Header: | #include <QWaylandView> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
qmake: | QT += waylandcompositor |
在 QML 中: | WaylandView |
继承: | QObject |
属性
- allowDiscardFrontBuffer : bool
- bufferLocked : bool
- output : QWaylandOutput*
- surface : QWaylandSurface*
公共功能
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 |
信号
void | allowDiscardFrontBufferChanged() |
void | bufferLockedChanged() |
void | outputChanged() |
void | surfaceChanged() |
属性文档
allowDiscardFrontBuffer : bool
默认情况下,视图会锁定当前缓冲区,直到调用advance() 为止。将此属性设置为true
可让 Qt 在主视图不再使用缓冲区时释放缓冲区。
这可用于避免次视图以较低频率更新时,会限制客户端程序的帧速率。
访问功能:
bool | allowDiscardFrontBuffer() const |
void | setAllowDiscardFrontBuffer(bool discard) |
通知信号
void | allowDiscardFrontBufferChanged() |
bufferLocked : bool
该属性显示视图的缓冲区当前是否锁定。当缓冲区被锁定时,advance() 将不会前进到下一个缓冲区,并返回false
。
默认值为false
。
访问函数:
bool | isBufferLocked() const |
void | setBufferLocked(bool locked) |
Notifier 信号:
void | bufferLockedChanged() |
output : QWaylandOutput*
该属性用于保存该视图显示其表面的输出。
访问功能:
QWaylandOutput * | output() const |
void | setOutput(QWaylandOutput *output) |
Notifier 信号:
void | outputChanged() |
surface : QWaylandSurface*
该属性保存此QWaylandView 查看的表面。
访问功能:
QWaylandSurface * | surface() const |
void | setSurface(QWaylandSurface *surface) |
Notifier 信号:
void | surfaceChanged() |
成员函数文档
QWaylandView::QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr)
使用给定的renderObject 和parent 构建一个 QWaylandView。
[override virtual noexcept]
QWaylandView::~QWaylandView()
摧毁QWaylandView.
[virtual]
bool QWaylandView::advance()
将当前缓冲区和损坏区域更新为客户端提交的最新版本。如果自上次调用 advance() 后有新内容提交,则返回 true。否则返回 false。
另请参阅 currentBuffer() 和currentDamage()。
[virtual]
void QWaylandView::bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage)
buffer damage 包含与当前缓冲区不同的区域,即需要更新的区域。新的 将在下一次调用 () 时成为当前缓冲区。buffer advance
重新实现此函数的子类必须调用基本实现。
[virtual]
QWaylandBufferRef QWaylandView::currentBuffer()
返回该视图当前缓冲区的引用。
[virtual]
QRegion QWaylandView::currentDamage()
返回该视图的当前损坏区域。
[virtual]
void QWaylandView::discardCurrentBuffer()
强制视图丢弃当前缓冲区,以便在客户端重新使用。
bool QWaylandView::isPrimary() const
如果QWaylandView 是主视图,则返回 true。QWaylandSurface
另请参见 QWaylandSurface::primaryView 。
void QWaylandView::setPrimary()
使QWaylandView 成为曲面的主视图。
如果该QWaylandView 不持有任何曲面,则该视图将不起作用。QWaylandSurface
另请参阅 isPrimary() 和QWaylandSurface::primaryView 。
struct wl_resource *QWaylandView::surfaceResource() const
返回此QWaylandView 的 Wayland 表面资源。
© 2025 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.