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

Behavior change: QUrl doesn't accept setPath without leading slash anymore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.0.0 Beta 1
    • Core: URL Handling
    • Mac OS X 10.8

    Description

      #include <QUrl>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QUrl url;
          url.setScheme(QLatin1String("http"));
          url.setAuthority("foo.bar.com");
          url.setPath("bla/blubb");
          qDebug() << url << url.isValid();
      
          url.setPath("/bla/blubb");
          qDebug() << url << url.isValid();
      }
      

      Running this with 4.8 gives

       QUrl( "http://foo.bar.com/bla/blubb" )  true 
       QUrl( "http://foo.bar.com/bla/blubb" )  true 
      

      Running this with Qt 5 gives

       QUrl( "" )  false 
       QUrl( "http://foo.bar.com/bla/blubb" )  true 
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            con Eike Ziller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes