本文介绍了在 Raspberry Pi 2 上运行简单的 QtWebEngine 应用程序,页面未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此

更新

我已经按照这个步骤-step教程(Poky fido 分支) 然后添加了qtwebengine(这次是import QtWebEngine 1.0)和qtwebengine-qmlplugins 在我的 Yocto Image 中并使用 bitbake

再次创建我的图像

当我启动并运行 /usr/bin/qt5/qmlscene -v -platform eglfschromium.qml 时,我可以看到我的 HTML 页面.

我测试了几十个网站,但并非所有页面都显示.所以他们可能会多一点.

例如

http://wikipedia.com 显示!!!http://google.com 不显示???http://https://stackoverflow.com/显示!!!http://facebook.com 没有

欢迎任何进一步的指示

更新 20160309

root@raspberrypi2:~/app# uname -aLinux raspberrypi2 4.1.10 #1 SMP PREEMPT Wed Feb 17 16:51:44 CET 2016 armv7l GNU/Linuxroot@raspberrypi2:~/app# lsb_release -aLSB 版本:core-4.1-noarch:core-4.1-arm经销商编号:poky描述:Poky(Yocto 项目参考发行版)2.0.1版本:2.0.1代号:jethro

QML

root@raspberrypi2:~/app# morechromium.qml导入 QtQuick 2.1导入 QtQuick.Controls 1.1导入 QtWebEngine 1.0应用程序窗口{宽度:800高度:600颜色:浅灰色"可见:真实网络引擎视图{id:网络视图//url: "http://raspberrypi.stackexchange.com/"//通过//url: "http://google.com"//失败//url: "http://video.webmfiles.org/big-buck-bunny_trailer.webm"//通过但没有声音//url: "https://youtube.com/"//失败//url: "https://opentokrtc.com/anybots"//失败//url: "http://speedof.me/"//通过url: "http://facebook.com"//失败anchors.fill:父级}}
解决方案

也许现在有点晚了,但我尝试在 Qt 5.6 alpha 中构建 QtWebEngine,它在 Raspberry Pi 2 上为我列出的所有 URL 正常工作.这是一个演示.也许他们在 QtWebEngine 中修复了一些东西,所以你可以尝试 5.6-alpha.

I compiled and installed QtWebEngine + QML plugins on Raspberry Pi 2 with Yocto recipes using information in this tutorial using Yocto dizzy branch and run the following script:

root@raspberrypi2:~# more chromium.qml 
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 0.9
ApplicationWindow {
    width: 1280
    height: 720
    color: "lightgray"
    visible: true
    WebEngineView {
        id: webview
        url: "file:///home/root/hello.html"
        anchors.fill: parent
    }
}

Note that the IMPORT VERSION 0.9, not 1.0

I have tried both url: "file:///home/root/hello.html" and url: "https://duckduckgo.com" but all I am getting is a red screen with the black square mouse pointer.

root@raspberrypi2:~# more hello.html 
<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>

On the console:

root@raspberrypi2:~# /usr/bin/qt5/qmlscene -v -platform eglfs chromium.qml 
[0605/163256:WARNING:resource_bundle.cc(280)] locale_file_path.empty()
[0605/163257:WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation
[0605/163257:WARNING:resource_bundle.cc(280)] locale_file_path.empty()

PAC support disabled ... seems to be a none issue read here

UPDATE

I have followed this step-by-step tutorial (Poky fido branch) and then added qtwebengine (import QtWebEngine 1.0 this time) and qtwebengine-qmlplugins in my Yocto Image and created again my image with bitbake

When I booted and ran /usr/bin/qt5/qmlscene -v -platform eglfs chromium.qml I could see my HTML page.

I have tested a couple of dozen of websites and not all page show. So their might be a little more to it.

e.g.

http://wikipedia.com shows!!! 
http://google.com doesn't show ???
http://https://stackoverflow.com/ shows!!!
http://facebook.com doesn't

Any further pointers are welcome

UPDATE 20160309

root@raspberrypi2:~/app# uname -a
Linux raspberrypi2 4.1.10 #1 SMP PREEMPT Wed Feb 17 16:51:44 CET 2016 armv7l GNU/Linux


root@raspberrypi2:~/app# lsb_release -a
LSB Version:    core-4.1-noarch:core-4.1-arm
Distributor ID: poky
Description:    Poky (Yocto Project Reference Distro) 2.0.1
Release:    2.0.1
Codename:   jethro

QML

root@raspberrypi2:~/app# more chromium.qml 
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 1.0

ApplicationWindow {
    width: 800
    height: 600
    color: "lightgray"
    visible: true
    WebEngineView {
        id: webview
        //url: "http://raspberrypi.stackexchange.com/" // PASS
        //url: "http://google.com" // FAIL
        //url: "http://video.webmfiles.org/big-buck-bunny_trailer.webm" // PASS but no Sound
        //url: "https://youtube.com/" // FAIL
        //url: "https://opentokrtc.com/anybots" // FAIL
        //url: "http://speedof.me/" // PASS
        url: "http://facebook.com"  // FAIL
        anchors.fill: parent
    }
}
解决方案

Maybe it is a little late but I tried to build QtWebEngine in Qt 5.6 alpha and it works properly for me on Raspberry Pi 2 for all the URLs you listed. This is a demo. Maybe they fixed something in QtWebEngine, so you can try 5.6-alpha.

这篇关于在 Raspberry Pi 2 上运行简单的 QtWebEngine 应用程序,页面未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 16:04