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

[Regression] First call to QTextBrowser::setSource fails unless URL created with QUrl::fromLocalFile

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.0.0
    • None

      The QTextBrowser autotest has a test function called relativeLinks(), which calls QTextBrowser::setSource() with a sequence of relative links. In Qt4, this test passes cleanly. In Qt5, the test passes, but outputs warnings indicating that it is really failing. The test was only checking that the correct signals were emitted, not that a document was actually loaded.

      The problem is that in Qt5 the first call to QTextBrowser::setSource always fails to load the document unless the specified URL is created with QUrl::fromLocalFile(). This is a regression from Qt4. After the first call, just passing a regular relative path to setSource works fine.

      I have improved the test to check that each call to QTextBrowser::setSource loads a non-empty document. This will of course fail until this regression is fixed, so I've added a QEXPECT_FAIL too.

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

            rodal Samuel Rødal
            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes