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

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

    XMLWordPrintable

Details

    • d90fb72c201efde8f9fc10c4fb4a542b1a26b9e8 7e89e6bfe8 (qt/qtbase/dev) 7e89e6bfe8 (qt/tqtc-qtbase/dev)

    Description

      The fragment is discarded when the scheme is set to "file", when using QDesktopServices::openUrl().
      If you copy this local address with the anchor into the browser, it works, meaning that the anchor (fragment) could be passed to the application, but is not.


      example
      #include <QtGui>
      int main (int argc, char **argv)
      {
          QApplication a(argc, argv);
          QString site("file:///C:/Qt/4.7.0/doc/html/qurl.html");
          QUrl url(site, QUrl::TolerantMode);
          url.setFragment("host");
          qWarning(QString(" URL: %1").arg(url.toString()).toStdString().c_str());
          QDesktopServices::openUrl(url);
          return a.exec();
      }
      

      Attachments

        Issue Links

          Activity

            People

              andysh Andy Shaw
              mawiesma Martin Wiesmann (closed Nokia identity) (Inactive)
              Votes:
              10 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: