在fido
分支See tutorial上使用Yocto构建 Raspberry Pi 2 Linux发行版,包括Qt5.4 + QtWebKit + 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"
看起来它仍然尝试从与{11}相关的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.
为什么我会遇到这个问题?
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
答案 0 :(得分:3)
也许qmlscene
正在吃参数 - 在qml文件的名称之前传递-platform
选项,或者将QT_QPA_PLATFORM
环境变量设置为eglfs
而不是命令行参数。
将来,您可能希望通过使用eglfs
配置Qt来使-qpa eglfs
成为默认选择。
答案 1 :(得分:0)
对我来说,我不得不打电话
export QT_QPA_PLATFORM="xxxxx"
在构建和运行之前。