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. How to open a local URL with QWebEngineView
Forum Updated to NodeBB v4.3 + New Features

How to open a local URL with QWebEngineView

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.9k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hisuin
    wrote on last edited by
    #1

    I am trying to load and show some local urls with QWebEngineView which are based on QtHelp in my application, but it is not possible. I have just managed to load either the HTML code or the text inside it thanks to a QHelpEnginem, but it is not possible to load the images, and the linking inside it does not work either. The urls could be previously displayed with QTextBrowser, but since I want to add some more advanced functionality to the html I would like to change to the QWebEngineView.

    Does anybody know how to do this, or if it is possible at all? Is it necessary to modify the base url?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, welcome to devnet.

      QWebEngineView is a component for displaying web or web-like content so this question can be answered by asking this cunning question: how would you like if random web pages could browse your computer for images whenever they wanted? I bet you wouldn't ;)

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hauke
        wrote on last edited by
        #3

        Hi,

        does Chris' answer imply that there is no way (or 'simple' way) to render Qt help from resource files with HTML support beyond the QTextBrowser functionality?

        If there is an alternative, does anybody have a hint?

        Regards,
        Hauke

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I might be wrong about this. If it's all in the same "domain" as the HTML ie. the resource file or local file, it might be ok, but I have no way to check right now.

          If it's an embedded resource you might try urls "qrc:///foo/bar.jpg" and for local files "file:///C:/foo/bar.jpg" but I doubt you can mix any of the two with HTML injected "from code".

          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