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

QUrl does not seem to handle relative file paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4: Low
    • None
    • 5.4.1
    • Core: URL Handling
    • None

    Description

      Clarification of original bug QTBUG-44890

      As noted in the discussion, QUrl::fromLocalFile() or QUrl::QUrl() do not appear to handle relative file paths... or file in current directory. Examples:

      QUrl::fromLocalFile("overview.html"); // does not load
      QUrl::fromLocalFile("./overview.html"); // does not load (but does not segfault)
      url=QUrl("file://overview.html");  // does not load
      url=QUrl("overview.html");  // does not load
      url=QUrl("file:///home/dave/qt5/qtwebkit-examples/examples/webkitwidgets/fancybrowser/overview.html");  // works
      

      Testing in another environment (SUSE 13.1) running Qt4.8.5, the behaviour is slightly different. This works:

      url=QUrl("overview.html");  // works
      url=QUrl("./overview.html");  // works
      

      So something seems broken between Qt4 and Qt5.

      If relative URL is not supported, that is fine, but documentation should reflect this limitation.

      This can be easily produced using fancybrowser example, main.cpp line 75.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            lapointe David LaPointe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes