How to Join URLs in QT

Python has truly manual functionality with urllib.parse.urljoin , in which it handles URL attachments, examples:

URL merge:

>>> urllib.parse.urljoin('https://something.a.com/api/v3/', 'some/end/point')
'https://something.a.com/api/v3/some/end/point'

I am looking at the QT documentation and I can not find anything like it. How do people deal with these two situations? I think I could manually combine things with QStrings, but that seems a bit cumbersome.

+4
source share
1 answer

QUrl::resolvedserves for this purpose. It combines the relative URL passed as an argument with the base url given by the instance you are calling it to:

auto full = base.resolved(relative);
+4
source

All Articles