gpt4 book ai didi

arm - Qt 应用程序尝试加载平台插件 "xcb"而不是 "eglfs"

转载 作者:行者123 更新时间:2023-12-01 00:51:47 25 4
gpt4 key购买 nike

已建 树莓派 2 linux 发行版,包括 Qt5.4 + QtWebKit + QML 插件,使用 Yocto on fido分公司See tutorial

使用以下 QML 脚本进行测试

root@raspberrypi2:~# more webkit3.qml 
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtWebKit 3.0

ScrollView {
width: 640
height: 480
WebView {
id: webview
url: "http://qt-project.org"
anchors.fill: parent
onNavigationRequested: {
// detect URL scheme prefix, most likely an external link
var schemaRE = /^\w+:/;
if (schemaRE.test(request.url)) {
request.action = WebView.AcceptRequest;
} else {
request.action = WebView.IgnoreRequest;
// delegate request.url here
}
}
}
}

错误信息

This application failed to start because it could not find or load the Qt platform plugin "xcb"



看来还是尝试从 XCB plugin开始这与 X11 有关,而我指定了 EGLFS (??)
root@raspberrypi2:~# /usr/bin/qt5/qmlscene  webkit3.qml -platform eglfs
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen.

Reinstalling the application may fix this problem.

任何想法为什么我会遇到这个问题?

已安装 QT5 插件平台
root@raspberrypi2:/usr/lib/qt5/plugins/platforms# ls -al
drwxr-xr-x 2 root root 4096 Jun 12 12:59 .
drwxr-xr-x 18 root root 4096 Jun 12 13:03 ..
-rwxr-xr-x 1 root root 601864 Jun 11 15:19 libqeglfs.so
-rwxr-xr-x 1 root root 499564 Jun 11 15:19 libqlinuxfb.so
-rwxr-xr-x 1 root root 20576 Jun 11 15:19 libqminimal.so
-rwxr-xr-x 1 root root 478500 Jun 11 15:19 libqminimalegl.so
-rwxr-xr-x 1 root root 465740 Jun 11 15:19 libqoffscreen.so

请不要向我推荐 thisthis问题。消息是相同的,但我不认为这是相同的原因。

最佳答案

也许 qmlscene正在吃参数——通过 -platform qml 文件名之前的选项,或设置 QT_QPA_PLATFORM环境变量到 eglfs而不是命令行参数。

为了将来,您可能想要制作 eglfs使用 -qpa eglfs 配置 Qt 的默认选择.

关于arm - Qt 应用程序尝试加载平台插件 "xcb"而不是 "eglfs",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30824501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com