Results 1 to 20 of 113

Thread: How to set QWebEngineView on QQuickView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How to set QWebEngineView on QQuickView

    I am porting from QGraphicsView to QQuickView.

    Like we load QGraphicsWebView on QGraphicsView, how to load QWebEngineView on QQuickView.

    currently I am setting it like below but it's not getting loaded.
    Qt Code:
    1. QuickViewReader::QuickViewReader(QWindow *parent): QQuickView(parent)
    2. {
    3. WebView = new WebEngineView();
    4. root = new QQmlContext(engine.rootContext());
    5. qmlRegisterType<WebEngineView>("WebView", 1,0, "WebEngineView");
    6.  
    7. /* Setting the current object into context of QML source */
    8. root->setContextProperty("rw", this);
    9. this->rootContext()->setContextProperty("rw", this);
    10. /* Setting the webview object into context of QML source */
    11. root->setContextProperty("webView",this->WebView);
    12.  
    13. QQmlComponent component(&engine);
    14. component.loadUrl(QUrl("qrc:/ReaderView.qml"));
    15. object = component.create(root);
    16.  
    17. setSource(QUrl("qrc:/ReaderView.qml"));
    18. setResizeMode(QQuickView::SizeRootObjectToView);
    19. }
    To copy to clipboard, switch view to plain text mode 
    The page is blank.
    When I explicitly call WebView.show(), the page is displayed.

    How to overlay QWebEngineView on QQuickView
    Last edited by ejoshva; 8th May 2015 at 13:22.

Similar Threads

  1. Loading QDeclarativeView in QWebEngineView
    By ejoshva in forum Newbie
    Replies: 8
    Last Post: 7th May 2015, 09:38
  2. Replies: 8
    Last Post: 23rd April 2015, 12:17
  3. QQuickView or QQmlApplicationEngine or QQuickWidget
    By ustulation in forum Qt Quick
    Replies: 0
    Last Post: 18th January 2015, 13:16
  4. Repaint a QML Scene (QQuickView)
    By alizadeh91 in forum Qt Programming
    Replies: 0
    Last Post: 23rd July 2013, 09:54
  5. Set fixed window size with QQuickView
    By cristeab in forum Qt Quick
    Replies: 1
    Last Post: 31st January 2013, 10:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.