Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Qt/QML: WebView resizes really slowly when window resizing

    General and Desktop
    1
    1
    636
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Diego Donate
      Diego Donate last edited by

      Hi,

      I have a Qt application with QML and I need to display a webBrowser inside a QML file.

      I have tried with Qml (using 'WebEngineView - QtWebEngine 1.1' or 'WebView - QtWebView 1.0') and in Qt (using 'QWebEngineView - Qt 5.6', with or without 'QWebEnginePage')

      The HTML is loaded properly, but when I resize the window, the content (including the scroll bar) is resized slowly to the new window size, so it has a really bad effect.

      My code is like that:

      1. QML:
      
      Item {
          id: rectChatView
      
          anchors.fill: parent
          ...
          WebEngineView  // or WebView
          {
              id: chatView
              anchors.fill: parent
              url: "file:///d:\\test.html"
          }
          ...
      }
      
      1. Qt

      With QWebEngineView:

          QWebEngineView* pViewWeb = new QWebEngineView();
          pViewWeb->setWindowTitle("QWebEngineView");
          pViewWeb->load(QUrl("file:///d:\\test.html"));
          pViewWeb->setMinimumSize(300,300);
          pViewWeb->show();
      

      or with QWebEnginePage:

          QWebEnginePage* pPage = new QWebEnginePage();
          pPage->load(QUrl("file:///d:\\test.html"));
      
      
          QWebEngineView* pView = new QWebEngineView();
          pView->setWindowTitle("QWebEngineView");
          pView->setMinimumSize(300,300);
          pView->setPage(pPage);
          pView->show();
      

      But the 3 ways have the same result, too slow when resizing the window...

      Any ideas? Thanks a lot in advance

      Diego

      1 Reply Last reply Reply Quote 2
      • First post
        Last post