LoongArch 版本 Qt WebEngine 安装文档


一、下载解压安装包

LoongArch版本Qt WebEngine下载路径为:http://ftp.loongnix.cn/qtwebengine/LoongArch/ 。本安装文档以v5.15.8版本为例,使用以下命令下载并解压主包:

[test@bogon:~]$ wget -c http://ftp.loongnix.cn/qtwebengine/LoongArch/v5.15.8/qtwebengine-5.15.8.tar.gz
[test@bogon:~]$ tar -xvf qtwebengine-5.15.8.tar.gz

执行完上述命令后,会在当前目录下生成qtwebengine-5.15.8文件夹,其中包含Qt WebEngine的相关文件。

二、配置环境变量

环境变量的配置用于确保Qt WebEngine及其相关程序能够正确找到所需的插件、库和资源文件。以下是临时设置环境变量的命令(仅在当前终端有效),将path_to_qt-5.15.8替换为实际解压后的qtwebengine-5.15.8文件夹路径:

[test@bogon:~]$ export QT_PLUGIN_PATH=path_to_qt-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/plugins
[test@bogon:~]$ export QT_IMPORTS_DIR=path_to_qt-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/qml
[test@bogon:~]$ export QML2_IMPORT_PATH=path_to_qt-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/qml
[test@bogon:~]$ export LD_LIBRARY_PATH=path_to_qt-5.15.8/usr/lib/loongarch64-linux-gnu
[test@bogon:~]$ export QTWEBENGINEPROCESS_PATH=path_to_qt-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/libexec/QtWebEngineProcess
[test@bogon:~]$ export QTWEBENGINE_RESOURCES_PATH=path_to_qt-5.15.8/usr/share/qt5/resources
[test@bogon:~]$ export QTWEBENGINE_LOCALES_PATH=path_to_qt-5.15.8/usr/share/qt5/translations

三、运行示例程序

pdfviewer是Qt官方提供的示例程序,展示了如何使用相关组件构建一个完整的PDF查看器。通过运行该示例程序,可以验证Qt WebEngine是否安装成功。从Qt示例目录运行该程序的步骤如下:

# 切换到示例程序目录
[test@bogon:~]$ cd qtwebengine-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/examples/pdfwidgets/pdfviewer
# 运行pdfviewer程序
[test@bogon:~/qtwebengine-5.15.8/usr/lib/loongarch64-linux-gnu/qt5/examples/pdfwidgets/]$ ./pdfviewer

执行程序后,将打开pdfviewer界面:

©龙芯开源社区 all right reserved,powered by Gitbook文档更新时间: 2025-07-03 16:42:44

results matching ""

    No results matching ""

    results matching ""

      No results matching ""