Important: Please read the Qt Code of Conduct -

Qt 5.6 how to use QWebEngineView in my custom widget plugin?

  • I'm trying to create a Qt custom widget plugin to wrap a QWebEngineView. But I found QWebEngineView seems does not work with Qt Designer.

    The demo code is attached as below. After build and place this plugin in Qt plugins folder, then Qt Designer will not launch correctly (No GUI window).

    If I remove the line m_web = new QWebEngineView();, then the plugin can be loaded by Qt Designer correctly.

    How to solve this issue?

    enter image description here


    #include <QWidget>
    #include <QWebEngineView>

    class WebViewWrapper : public QWidget

    WebViewWrapper(QWidget *parent = 0);

    QWebEngineView* m_web;


    // webviewwrapper.cpp
    #include "webviewwrapper.h"

    WebViewWrapper::WebViewWrapper(QWidget *parent) :
    m_web = new QWebEngineView(); // if I remove this line, the plugin will be loaded correctly