QWaylandPresentationTime Class

QWaylandPresentationTime 类是一个用于获取屏幕演示计时的扩展。更多

Header: #include <QWaylandPresentationTime>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
Qt 6.3
在 QML 中: PresentationTime
继承: QWaylandCompositorExtensionTemplate

公共函数

QWaylandPresentationTime()
QWaylandPresentationTime(QWaylandCompositor *compositor)
void sendFeedback(QQuickWindow *window, quint64 sequence, quint64 tv_sec, quint32 tv_nsec)

重新实现的公共函数

virtual void initialize() override

静态公共成员

const struct wl_interface *interface()

详细描述

QWaylandPresentationTime 扩展提供了一种跟踪曲面渲染时序的方法。客户端可以请求与曲面相关的反馈,然后合成器会根据曲面在屏幕上呈现的时间发送反馈事件。

QWaylandPresentationTime 与 Waylandwp_presentation 接口相对应。

成员函数文档

QWaylandPresentationTime::QWaylandPresentationTime()

构造一个空的 QWaylandPresentationTime 对象。

QWaylandPresentationTime::QWaylandPresentationTime(QWaylandCompositor *compositor)

compositor 构建一个 QWaylandPresentationTime 对象。

[override virtual] void QWaylandPresentationTime::initialize()

重新实现:QWaylandCompositorExtension::initialize().

初始化扩展。

[static] const struct wl_interface *QWaylandPresentationTime::interface()

返回QWaylandPresentationTime 的 Wayland 界面。

[invokable] void QWaylandPresentationTime::sendFeedback(QQuickWindow *window, quint64 sequence, quint64 tv_sec, quint32 tv_nsec)

使用window 在屏幕上显示帧时发出通知的接口。如果您的平台支持 DRM 事件,page_flip_handler 就是正确的发送时间。sequence 是刷新计数器。tv_sectv_nsec 分别保存呈现时间戳的秒和纳秒部分。

注: 可通过元对象系统和 QML 调用此函数。请参见Q_INVOKABLE

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