[Qt-interest] QUrl deficiency?
Thiago Macieira
thiago at kde.org
Sat Jul 10 15:48:34 CEST 2010
On Saturday 10. July 2010 14.56.08 Mandeep Sandhu wrote:
> > I have a url - "http://server/A/B/C" and I want to manipulate it to
> > get something like "http://server/A/D/E". Could not find anything in
> > QUrl to help me with this problem.
> >
> > I can use the resolved() API to append the "D/F" relative path. But I
> > need to get to "http://server/A" part first!! :)
>
> I found something close to what I wanted. I can use setPath("A/D/E")
> on the url. This completely replaces the existing path. It would've
> been nice to have the add/remove kind of API for paths too though.
Add a part:
url = url.resolved("partToAdd");
Remove a part:
url = url.resolved("../");
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100710/70a9880b/attachment.bin
More information about the Qt-interest-old
mailing list