Important: Please read the Qt Code of Conduct -

QT Web Engine freezes when calling any method from main.cpp

  • Hello,
    now I have another problem. When I try to load another URL from main.cpp with the overload method, the whole application freezes and crashes. What am I doing wrong here? I have done the same like described in

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include <QtQuick/QtQuick>
    #include <QtWebView/QtWebView>
    #include <QtWebEngineWidgets/QWebEngineView>
    int main(int argc, char *argv[])
        QGuiApplication app(argc, argv);
        QQuickView view;
        QObject *object = view.rootObject();
        QQuickItem *item = qobject_cast<QQuickItem*>(object);
        QWebEngineView* rect = item->findChild<QWebEngineView*>("view");
        QVariant msg = "";
        return app.exec();


    import QtQuick 2.6
    import QtQuick.Window 2.2
    import QtWebEngine 1.0
    Item {
        visible: true
        width: 1500
        height: 800
       // title: qsTr("CENSORED")
        WebEngineView {
            id: view
            anchors.fill: parent
            url: "CENSORED"
            objectName: "view"

  • Moderators

    @aphi QWebEngineView* rect = item->findChild<QWebEngineView*>("view"); you never test the result here. It can be null and if it was null it would crash.

    Can you run this in a debugger and give a backtrace of the crash?

Log in to reply