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 Illegal Instruction
Forum Updated to NodeBB v4.3 + New Features

QtWebEngine Illegal Instruction

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 420 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rscr
    wrote on 4 Feb 2020, 09:24 last edited by
    #1

    Hi,

    I am developing a QT app for rpi 0 w. I have used buildroot to create my own image. I have a Qt app running on it, and now I need to add a web browser to my app. On a first approach I am using WebEngineView, but the app is not running, and I only have the import QtWebEngine 1.8, no more code related to WebEngine

    # ./cp4gui -platform eglfs
    Illegal instruction
    

    .pro file

    QT += quick webengine
    
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Refer to the documentation for the
    # deprecated API to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            QTcp4Conf.cpp \
            main.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    
    HEADERS += \
        QTcp4Conf.h
    
    • Qt PageForm:
    import QtQuick 2.7
    import QtQuick.Controls 2.0
    import QtGraphicalEffects 1.0
    import QtWebEngine 1.0
    
    
    Page {
        id: page2
        width: 800
        height: 480
        title: qsTr("")
    
        /*WebEngineView{
            url: "https:/"
            //preferredWidth: 490
            //preferredHeight: 400
            scale: 0.5
            smooth: false
        }*/
    
    }
    
    • Qt main.cpp
    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include "QTcp4Conf.h"
    #include <qtwebengineglobal.h>
    
    
    
    // ------------------ MAIN ----------------------------------------
    int main(int argc, char *argv[])
    {
    
       // enables the virtual keyboard by setting the QT_IM_MODULE
       qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    
       // lets the web view automatically scale on high-dpi displays
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    
        //initis the QtWebEngine
        QtWebEngine::initialize();
    
        QGuiApplication app(argc, argv);
    
        // Añadir tipos propios
        qmlRegisterType<QTcp4Conf>("com.rscr.cp4",1,0,"QTcp4Conf");
    
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    
        return app.exec();
    }
    

    Any idea?

    Kind Regards,

    Rafa

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RiccardoS
      wrote on 19 Apr 2021, 09:51 last edited by
      #2

      I have the same problem.
      I've compiled the WebEngine Quick Nano Browser example for my Raspberry Pi Zero. When I try to run the application I get the "illegal instruction" error.

      The root filesystem and SDK are generated with buildroot-2021.02.1.tar.gz using the bcmrpi_defconfig.
      I use eglfs as platform plugin. It works without problems with the other OpenGL examples.

      The other Qt modules (core, network, gui etc. etc.) works perfectly.

      Someone has some tip to fix this problem?

      Thanks

      1 Reply Last reply
      0

      • Login

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