Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Externaly open local HTML file

Externaly open local HTML file

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 1.5k 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.
  • D Offline
    D Offline
    DavidM29
    wrote on last edited by DavidM29
    #1

    Hello,
    I would like to open a local HTML file on the computer web browser.
    But I don't know how to achieve this. Can somebody help me ?
    I tried this :

    Qt.openUrlExternally("help.html")
    

    but it does not work : here is the error message I have :

    ShellExecute 'qrc:/help.html' failed 
    
    Pablo J. RoginaP K 2 Replies Last reply
    0
    • D DavidM29

      Hello,
      I would like to open a local HTML file on the computer web browser.
      But I don't know how to achieve this. Can somebody help me ?
      I tried this :

      Qt.openUrlExternally("help.html")
      

      but it does not work : here is the error message I have :

      ShellExecute 'qrc:/help.html' failed 
      
      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @DavidM29 it seems you need to fully qualify the page you want to open.

      Qt.openUrlExternally("http://some-server-name-or-ip/help.html")
      

      or

      Qt.openUrlExternally("file:///path/to/help.html")
      

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • D DavidM29

        Hello,
        I would like to open a local HTML file on the computer web browser.
        But I don't know how to achieve this. Can somebody help me ?
        I tried this :

        Qt.openUrlExternally("help.html")
        

        but it does not work : here is the error message I have :

        ShellExecute 'qrc:/help.html' failed 
        
        K Offline
        K Offline
        kenchan
        wrote on last edited by
        #3

        @DavidM29

        How about this?

        QDesktopServices::openUrl(QUrl("help.html"));
        
        1 Reply Last reply
        0
        • D Offline
          D Offline
          DavidM29
          wrote on last edited by DavidM29
          #4

          @Pablo-J-Rogina @kenchan
          Thank you for those answer !
          This line worked :

          Qt.openUrlExternally("file:///path/to/help.html")
          

          I also tried @kenchan's solution but it did not work Qt can't find QUrl so maybe problem with a missing import. But anyway find a good solution.

          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