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 31 May 2018, 14:29 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 
    
    P K 2 Replies Last reply 31 May 2018, 17:07
    0
    • D DavidM29
      31 May 2018, 14:29

      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 
      
      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 31 May 2018, 17:07 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
        31 May 2018, 14:29

        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 1 Jun 2018, 01:12 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 1 Jun 2018, 05:46 last edited by DavidM29 6 Jan 2018, 06:37
          #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

          4/4

          1 Jun 2018, 05:46

          • Login

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