QQuickView and QWebEngineView



  • I am porting from QDeclarativeView/QGraphicsWebView to QQuickView/QWebEngineView
    I find here that QQuickView is QWindow type and QWebEngineView is QWidget type.

    QQuickView , I am making use of extensively to enable the QML functionalities.
    To display the page alone, QWebEngineView I am using and also for actions made on that page like highlight, annotation, search, mouseWheelRoll etc.

    Is it possible to overlay QWebEngineView on QQuickView just like we do in QGraphicsWebView on QDeclarativeView.

    I have just made the object of the WebEngineView in the constructor of QuickView. But page is displayed blank. When I explicitly call WebEngineView.show(), the page is displayed on the WebEngineView.

    QuickViewReader::QuickViewReader(QWindow *parent): QQuickView(parent)
    {
    WebView = new WebEngineView();

    //root = this->rootContext();
    root = new QQmlContext(engine.rootContext());
    qmlRegisterType<WebEngineView>("WebView", 1,0, "WebEngineView");
    

    /* Setting the current object into context of QML source /
    root->setContextProperty("rw", this);
    this->rootContext()->setContextProperty("rw", this);
    /
    Setting the webview object into context of QML source */
    root->setContextProperty("webView",this->WebView);

    QQmlComponent component(&engine);
    component.loadUrl(QUrl("qrc:/ReaderView.qml"));
    object = component.create(root);

    setSource(QUrl("qrc:/ReaderView.qml"));
    setResizeMode(QQuickView::SizeRootObjectToView);
    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.