【发布时间】:2015-06-13 23:19:10
【问题描述】:
在fido 分支See tutorial 上使用Yocto 构建Raspberry Pi 2 linux 发行版,包括Qt5.4 + QtWebKit + QML 插件
使用以下 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
}
}
}
}
错误消息
此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“xcb”
看起来它仍在尝试以与 X11 相关的 XCB plugin 开头,而我指定了 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
【问题讨论】:
-
也许
qmlscene正在吃掉参数——你有没有试过在qml 文件名之前传递-pletform选项?或者将QT_QPA_PLATFORM环境变量设置为eglfs而不是命令行参数? -
你的建议很成功!!请添加您的评论作为我验证的答案。干杯!!
标签: arm qml qtwebkit yocto qt5.4