Results 1 to 20 of 113

Thread: How to set QWebEngineView on QQuickView

Hybrid 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set QWebEngineView on QQuickView

    What is this WebEngineView class?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.