Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7827

Mac : QDesktopServices::openUrl() ignores anchor on local files.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.6.1
    • Core: URL Handling
    • None
    • Tested on Snow Leopard.
    • macOS

    Description

      It looks like the openUrl() just uses if the Scheme specified is "file". This discards the fragment part of the url, making it difficult for applications to open specific anchors in local html files.

      It looks like the method we use for remote urls LSOpenCFURLRef might have this issue as well,

      http://lists.apple.com/archives/Carbon-development/2002/Jul/msg00071.html

      Perhaps it's time to move this to cocoa?

      #include <QtGui>
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
              QUrl url("/Developer/Documentation/Qt/html/qurl.html");
              url.setScheme("file");
              url.setFragment("setFragment");
              QDesktopServices::openUrl(url);
          return -1;
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              cduclos Carlos Duclos (Inactive)
              dettman Dean Dettman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes