Results 1 to 8 of 8

Thread: QDesktopServices::openUrl with location hash fails on Windows and Mac

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDesktopServices::openUrl with location hash fails on Windows and Mac

    The file: scheme URL is ultimately converted to a file path using QUrl::toLocalFile() in the QDesktopServices code, and it is this that strips the fragment identifier (which is defined for the http scheme but not file). If you paste the same file: URL into the Windows run box you get the same result, so even if Qt did not do this, Windows would.

    You could try installing your own URL handler (see QDesktopServices::setUrlHandler()) and use it to launch a browser directly. Then, for example, the URL local://path/to/file#fragment can do anything you like in response to openUrl().

  2. The following user says thank you to ChrisW67 for this useful post:

    mtnbiker66 (28th September 2012)

Similar Threads

  1. QDesktopServices::openUrl() slow
    By rbp in forum Qt Programming
    Replies: 10
    Last Post: 23rd January 2011, 16:30
  2. local html file and QDesktopServices::openUrl
    By ntp in forum Qt Programming
    Replies: 1
    Last Post: 19th August 2010, 08:05
  3. Replies: 1
    Last Post: 3rd February 2010, 04:45
  4. QDesktopServices::openUrl - Problem
    By rmagro in forum Qt Programming
    Replies: 8
    Last Post: 2nd April 2009, 14:21
  5. QDesktopServices::openUrl and HTML fragments
    By roro in forum Qt Programming
    Replies: 2
    Last Post: 18th June 2007, 17:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.