#includeIn the above example, we create an instance of KUrl by passing a URL string to the constructor. We then use the setProtocol() function to change the protocol of the URL to "ftp". Finally, we print the modified URL using the prettyUrl() function. Package library: KDE Frameworks.int main() { QString url_string = "https://www.example.com"; KUrl url(url_string); url.setProtocol("ftp"); qDebug() << url.prettyUrl(); return 0; }