Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QTWebEngine on Zynq-7000
Forum Updated to NodeBB v4.3 + New Features

QTWebEngine on Zynq-7000

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 184 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kiyenko
    wrote on last edited by
    #1

    Hi.
    I'm trying to run a simple full-screen browser in Linux framebuffer on Zynq-7000. I already manage to do that using QTWebKit, but now I'm trying to do the same with QTWebEngine, as QTWebKit is outdated and does not support the features I want to use.
    I found the simplest possible example code:

    webengine.pro

    TARGET = browser
    TEMPLATE = app
    SOURCES = main.cpp
    QT += qml quick webengine
    

    main.cpp

    #include <QtGui/QGuiApplication>
    #include <QtQml/QQmlApplicationEngine>
    #include <QtWebEngine/qtwebengineglobal.h>
    
    int main(int argc, char *argv[])
    {
      QGuiApplication app(argc, argv);
      QtWebEngine::initialize();
      QQmlApplicationEngine appEngine;
      appEngine.load(QUrl("main.qml"));
    
      return app.exec();
    }
    

    main.qml

    import QtQuick 2.0
    import QtWebEngine 1.0
    import QtQuick.Window 2.0
    
    WebEngineView {
      width: Screen.width
      height: Screen.height
      url: 'http://127.0.0.1'
    }
    

    After many tries, I found the way to build this application using a modified Docker container from https://github.com/Screenly/Anthias/tree/master/webview. My modification was to use balenalib/zynq-xz702:bookworm as the builder, instead of the image for Raspberry Pi.
    I have already installed QT5 packages in this system.

    root@arm:/media/sd-mmcblk0p1/pi3# apt list --installed |grep libqt5
    libqt5core5a/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5dbus5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5gui5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5network5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5positioning5/oldstable,now 5.15.8+dfsg-3+deb12u1 armhf [installed,automatic]
    libqt5printsupport5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5qml5/oldstable,now 5.15.8+dfsg-3 armhf [installed]
    libqt5qmlmodels5/oldstable,now 5.15.8+dfsg-3 armhf [installed,automatic]
    libqt5quick5/oldstable,now 5.15.8+dfsg-3 armhf [installed]
    libqt5quickwidgets5/oldstable,now 5.15.8+dfsg-3 armhf [installed,automatic]
    libqt5sensors5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5svg5/oldstable,now 5.15.8-3 armhf [installed,automatic]
    libqt5test5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5texttospeech5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5waylandclient5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5waylandcompositor5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5webchannel5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5webengine-data/oldstable,now 5.15.13+dfsg-1~deb12u1 all [installed,automatic]
    libqt5webengine5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
    libqt5webenginecore5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
    libqt5webenginewidgets5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
    libqt5webkit5/oldstable,now 5.212.0~alpha4-30 armhf [installed]
    libqt5widgets5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    libqt5x11extras5/oldstable,now 5.15.8-2 armhf [installed,automatic]
    libqt5xml5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
    

    Now, when I try to run application on the target system (Zynq-7000 with Debian 12) I got an error:

    QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.
    This plugin does not support createPlatformOpenGLContext!
    Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
    qt.qpa.input: evdevtouch: Using device /dev/input/event0
    qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B (mtdev) (multi), filtered=no
    qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 0
    qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 0
    qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 4095
    qt.qpa.input: evdevtouch: /dev/input/event0: device name: TSC2007 Touchscreen
    QQmlApplicationEngine failed to load component
    file:///media/sd-mmcblk0p1/pi3/main.qml:3:1: module "QtQuick.Window" is not installed
    file:///media/sd-mmcblk0p1/pi3/main.qml:2:1: module "QtWebEngine" is not installed
    file:///media/sd-mmcblk0p1/pi3/main.qml:3:1: module "QtQuick.Window" is not installed
    file:///media/sd-mmcblk0p1/pi3/main.qml:2:1: module "QtWebEngine" is not installed
    Illegal instruction
    

    Looks like I have to configure (or fix) some environment variables, but I'm new to QT and really don't know how to debug this issue.
    Please help me make it work.

    JonBJ 1 Reply Last reply
    0
    • K Kiyenko

      Hi.
      I'm trying to run a simple full-screen browser in Linux framebuffer on Zynq-7000. I already manage to do that using QTWebKit, but now I'm trying to do the same with QTWebEngine, as QTWebKit is outdated and does not support the features I want to use.
      I found the simplest possible example code:

      webengine.pro

      TARGET = browser
      TEMPLATE = app
      SOURCES = main.cpp
      QT += qml quick webengine
      

      main.cpp

      #include <QtGui/QGuiApplication>
      #include <QtQml/QQmlApplicationEngine>
      #include <QtWebEngine/qtwebengineglobal.h>
      
      int main(int argc, char *argv[])
      {
        QGuiApplication app(argc, argv);
        QtWebEngine::initialize();
        QQmlApplicationEngine appEngine;
        appEngine.load(QUrl("main.qml"));
      
        return app.exec();
      }
      

      main.qml

      import QtQuick 2.0
      import QtWebEngine 1.0
      import QtQuick.Window 2.0
      
      WebEngineView {
        width: Screen.width
        height: Screen.height
        url: 'http://127.0.0.1'
      }
      

      After many tries, I found the way to build this application using a modified Docker container from https://github.com/Screenly/Anthias/tree/master/webview. My modification was to use balenalib/zynq-xz702:bookworm as the builder, instead of the image for Raspberry Pi.
      I have already installed QT5 packages in this system.

      root@arm:/media/sd-mmcblk0p1/pi3# apt list --installed |grep libqt5
      libqt5core5a/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5dbus5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5gui5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5network5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5positioning5/oldstable,now 5.15.8+dfsg-3+deb12u1 armhf [installed,automatic]
      libqt5printsupport5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5qml5/oldstable,now 5.15.8+dfsg-3 armhf [installed]
      libqt5qmlmodels5/oldstable,now 5.15.8+dfsg-3 armhf [installed,automatic]
      libqt5quick5/oldstable,now 5.15.8+dfsg-3 armhf [installed]
      libqt5quickwidgets5/oldstable,now 5.15.8+dfsg-3 armhf [installed,automatic]
      libqt5sensors5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5svg5/oldstable,now 5.15.8-3 armhf [installed,automatic]
      libqt5test5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5texttospeech5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5waylandclient5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5waylandcompositor5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5webchannel5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5webengine-data/oldstable,now 5.15.13+dfsg-1~deb12u1 all [installed,automatic]
      libqt5webengine5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
      libqt5webenginecore5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
      libqt5webenginewidgets5/oldstable,now 5.15.13+dfsg-1~deb12u1 armhf [installed]
      libqt5webkit5/oldstable,now 5.212.0~alpha4-30 armhf [installed]
      libqt5widgets5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      libqt5x11extras5/oldstable,now 5.15.8-2 armhf [installed,automatic]
      libqt5xml5/oldstable,now 5.15.8+dfsg-11+deb12u3 armhf [installed,automatic]
      

      Now, when I try to run application on the target system (Zynq-7000 with Debian 12) I got an error:

      QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.
      This plugin does not support createPlatformOpenGLContext!
      Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
      qt.qpa.input: evdevtouch: Using device /dev/input/event0
      qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B (mtdev) (multi), filtered=no
      qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 0
      qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 0
      qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 4095
      qt.qpa.input: evdevtouch: /dev/input/event0: device name: TSC2007 Touchscreen
      QQmlApplicationEngine failed to load component
      file:///media/sd-mmcblk0p1/pi3/main.qml:3:1: module "QtQuick.Window" is not installed
      file:///media/sd-mmcblk0p1/pi3/main.qml:2:1: module "QtWebEngine" is not installed
      file:///media/sd-mmcblk0p1/pi3/main.qml:3:1: module "QtQuick.Window" is not installed
      file:///media/sd-mmcblk0p1/pi3/main.qml:2:1: module "QtWebEngine" is not installed
      Illegal instruction
      

      Looks like I have to configure (or fix) some environment variables, but I'm new to QT and really don't know how to debug this issue.
      Please help me make it work.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @Kiyenko said in QTWebEngine on Zynq-7000:

      QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.

      For this one why not fix? https://doc.qt.io/archives/qt-5.15/qtwebengine.html#initialize tells you

      Sets up an OpenGL Context that can be shared between threads. This has to be done before QGuiApplication is created and before window's QPlatformOpenGLContext is created.

      so it belongs before QGuiApplication app(argc, argv);.

      And maybe same for

      Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.

      though that may not affect the

      This plugin does not support createPlatformOpenGLContext!

      and the other complaints.

      1 Reply Last reply
      1
      • K Offline
        K Offline
        Kiyenko
        wrote on last edited by
        #3

        Thanks @JonB, now I see fewer warnings

        root@arm:/media/sd-mmcblk0p1# ./browser
        QStandardPaths: wrong permissions on runtime directory /media/sd-mmcblk0p1/qt_runtime, 0755 instead of 0700
        qt.qpa.input: libinput: event0  - TSC2007 Touchscreen: is tagged by udev as: Touchscreen
        qt.qpa.input: libinput: event0  - TSC2007 Touchscreen: device is a touch device
        qt.qpa.input: libinput: event1  - gpio-keys: is tagged by udev as: Keyboard
        qt.qpa.input: libinput: event1  - gpio-keys: device is a keyboard
        qt.qpa.input: Using xkbcommon for key mapping
        qt.qpa.input: libinput: registerDevice /dev/input/event0 - TSC2007 Touchscreen
        This plugin does not support createPlatformOpenGLContext!
        qt.qpa.input: evdevtouch: Adding device at /dev/input/event0
        qt.qpa.input: evdevtouch: Using device /dev/input/event0
        qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B (mtdev) (multi), filtered=no
        qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 0
        qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 0
        qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 4095
        qt.qpa.input: evdevtouch: /dev/input/event0: device name: TSC2007 Touchscreen
        QQmlApplicationEngine failed to load component
        file:///media/sd-mmcblk0p1/main.qml:3:1: module "QtQuick.Window" is not installed
        file:///media/sd-mmcblk0p1/main.qml:2:1: module "QtWebEngine" is not installed
        file:///media/sd-mmcblk0p1/main.qml:3:1: module "QtQuick.Window" is not installed
        file:///media/sd-mmcblk0p1/main.qml:2:1: module "QtWebEngine" is not installed
        Illegal instruction
        

        but the main problem is still here

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved