Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. the QWebEngineView signal of loadfinished is not very precise
Forum Updated to NodeBB v4.3 + New Features

the QWebEngineView signal of loadfinished is not very precise

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 191 Views
  • 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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    I made a project used the QWebEngineView,and connect the signal loadfinished to the slot function.but when I get the signal from the QWebEngineView which loadfished,i found that the QWebEngineView dosent loaded all the elements of the webview,in fact the QWebEngineView was still rendering the web resources.so how could i get the precise signal that the QWebEngineView was totally rendered.

    JonBJ 1 Reply Last reply
    0
    • nicker playerN nicker player

      I made a project used the QWebEngineView,and connect the signal loadfinished to the slot function.but when I get the signal from the QWebEngineView which loadfished,i found that the QWebEngineView dosent loaded all the elements of the webview,in fact the QWebEngineView was still rendering the web resources.so how could i get the precise signal that the QWebEngineView was totally rendered.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @nicker-player
      loadFinished() is issued when the engine finishes loading the HTML page. This does not mean everything on the page is "finished" as there can be further processing, JavaScript etc. I found I needed to write some JavaScript/jQuery attached to "onload"/"DOMContentLoaded"/"document ready" if you want to act on the page being "finished" client-side.

      nicker playerN 1 Reply Last reply
      4
      • JonBJ JonB

        @nicker-player
        loadFinished() is issued when the engine finishes loading the HTML page. This does not mean everything on the page is "finished" as there can be further processing, JavaScript etc. I found I needed to write some JavaScript/jQuery attached to "onload"/"DOMContentLoaded"/"document ready" if you want to act on the page being "finished" client-side.

        nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote on last edited by
        #3

        @JonB
        so could u just give a little more detail information about that?
        its would be better if u could give me a demo or a link.its hard for me to get the tips from the internet.

        JonBJ 1 Reply Last reply
        0
        • nicker playerN nicker player

          @JonB
          so could u just give a little more detail information about that?
          its would be better if u could give me a demo or a link.its hard for me to get the tips from the internet.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @nicker-player
          I am afraid I used this years ago, I cannot find any source of mine using it and am hazy as to what I did how.

          For your case, is the page/HTML you are using in your QWebEngineView constructed by your code or is it an external URL? If it's the former, your own, you can put some JS into it to run on "document ready" JS/jQuery. If it's the latter, an external URL, I am not sure when you can use, say, runJavaScript to inject the JS code.

          Alternatively, I think you are now encouraged to use QWebChannel in QWebEnginePage to communicate "properly" with the JS and hence the DOM model. This did not yet exist when I did work years ago. An example in Python seems to be https://riverbankcomputing.com/pipermail/pyqt/2015-August/036346.html, there may be other/better ones. The important thing is that uses script.setInjectionPoint(QWebEngineScript.DocumentReady) to install the script to run on the page's "document ready".

          I am afraid I am not going to be able to give any more precise suggestions that the above.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved