Qt Wayland Compositor QML Types

Qt Wayland 模块提供了 QML 类型,可用于创建支持 Wayland 协议的自定义显示服务器。

可使用以下导入语句将 QML 类型导入应用程序:

使用模块

使用 Qt 模块的 C++ API 需要直接或通过其他依赖项链接模块库。有几种构建工具为此提供了专门支持,包括CMakeqmake

使用 CMake 构建

使用find_package() 命令在Qt6 软件包中找到所需的模块组件:

find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)

更多详情,请参阅使用 CMake 构建概述。

使用 qmake 构建

要配置模块以便用 qmake 构建,请在项目的 .pro 文件中添加模块作为QT 变量的值:

QT += waylandcompositor

QML 导入

import QtWayland.Compositor

有关在应用程序中使用这些类型的更多信息,请参阅 Qt Wayland Compositor文档。

IdleInhibitManagerV1

提供一个扩展,可抑制合成器的空闲行为

QtTextInputMethodManager

提供对合成器中输入方法的访问权限

ShellSurface

为外壳扩展指定的表面角色提供通用接口

ShellSurfaceItem

用于显示 ShellSurface 并与之交互的Qt Quick 项目类型

TextInputManager

为合成器中的输入方法提供访问权限

WaylandClient

代表连接到 WaylandCompositor 的客户端

WaylandCompositor

管理 Wayland 显示服务器

WaylandHardwareLayer

使父WaylandQuickItem使用硬件层进行渲染

WaylandOutput

提供对由合成器管理的可显示区域的访问权限

WaylandQuickItem

提供一个代表 WaylandView 的Qt Quick 项目

WaylandSeat

提供键盘、鼠标和触摸输入的访问权限

WaylandSurface

代表输出设备上的矩形区域

WaylandView

代表输出设备上的表面视图

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