[Development] QUrl setPath Qt4 vs Qt5

Samuel Gaist samuel.gaist at edeltech.ch
Sun Sep 28 01:02:11 CEST 2014


Hi,

Following a post on the forum, I've checked and there's been a behavior change in QUrl's setPath between Qt 4 and Qt 5 that is not mentioned in the "C++ API changes" chapter. 

If I understood correctly:

QUrl example1("http://www.example.com");
example1.setPath("pub/something");

makes example1 invalid in Qt 5 due to the fact that "pub/something" is a relative path (following QUrl documentation and test) but in Qt 4 the result is "http://www.example.com/pub/something".

Should it be considered bug in Qt 4 that needs fixing ? However fixing it might break existing application that could be relying on that behavior. In this case, simply add the API break in Qt 5's documentation ?

Samuel


More information about the Development mailing list