QUrl url("http://www.example.com"); url.setPath("/index.html");
QUrl url("ftp://ftp.example.com"); url.setPath("/downloads/files/pictures/");In this example, the path component of the URL is set to "/downloads/files/pictures/". The QUrl class is part of the Qt Core library.