Qt UI Tools C++ Classes

提供用于处理使用Qt Widgets Designer 创建的表单的类。更多

QUiLoader

使独立应用程序能够在运行时使用 UI 文件中存储的信息或插件路径中指定的信息动态创建用户界面。

详细说明

这些表单在运行时进行处理,以生成动态创建的用户界面。要在运行时生成表单,需要一个包含用户界面文件的资源文件。使用表单处理类的应用程序需要配置为根据 QtUiTools 模块构建。具体做法是在qmake 项目文件中加入以下声明,以确保应用程序能正确编译和链接。

QT += uitools

QUiLoader 类提供的表单加载器对象用于构建用户界面。该用户界面可从任何QIODevice 中获取;例如,可使用QFile 对象获取存储在项目资源中的表单。QUiLoader::load() 函数获取文件中包含的用户界面描述,并构建表单部件。

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