[Qt-interest] Strange behaviour of QUrl::resolved() using 'file' paths
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Tue May 24 09:38:44 CEST 2011
Hi All,
I'm not sure if this is the expected behaviour or not....but the
QUrl::resolved(QUrl &) is giving strange result when trying to merge a
complete url with a relative one.
Eg:
QUrl baseUrl("/home/mandeep/urltest");
qDebug() << "Base url is" << baseUrl.toString();
QUrl res = baseUrl.resolved(QUrl("../bin"));
qDebug() << "Resolved url=" << res.toString();
This gives the following output:
Base url is "/home/mandeep/urltest"
Resolved url= "/home/bin"
Shouldn't the resolved url have been /home/mandeep/bin (since I'm
doing "../bin").
However, if I set the relative url to "./bin" (single dot before
slash), it gives:
Resolved url= "/home/mandeep/bin"
Is this expected? I thought the "../" notation worked similar to how
'cd' interprets it...i.e "1 level up".
Thanks,
-mandeep
More information about the Qt-interest-old
mailing list