【问题标题】:Qt application trying to load platform plugin "xcb" instead of "eglfs"Qt 应用程序试图加载平台插件“xcb”而不是“eglfs”
【发布时间】: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

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

【问题讨论】:

  • 也许qmlscene 正在吃掉参数——你有没有试过在qml 文件名之前传递-pletform 选项?或者将QT_QPA_PLATFORM环境变量设置为eglfs而不是命令行参数?
  • 你的建议很成功!!请添加您的评论作为我验证的答案。干杯!!

标签: arm qml qtwebkit yocto qt5.4


【解决方案1】:

也许qmlscene 正在吃掉参数——在 qml 文件名之前传递-platform 选项,或者将QT_QPA_PLATFORM 环境变量设置为eglfs 而不是命令行参数。

对于未来,您可能希望通过将 Qt 配置为 -qpa eglfs 来将 eglfs 设为默认选择。

【讨论】:

    【解决方案2】:

    对我来说,我不得不打电话

    export QT_QPA_PLATFORM="xxxxx"
    

    在构建和运行之前。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 2016-01-08
      • 2017-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-06
      相关资源
      最近更新 更多