#includeKUrl url("https://www.example.com/page.html"); QString host = url.host(); // "www.example.com" QString path = url.path(); // "/page.html"
KUrl baseUrl("https://www.example.com/"); KUrl url = baseUrl.resolved("page.html"); // "https://www.example.com/page.html"
KUrl url("https://www.example.com/page.html"); url.setQuery("param=value"); QString urlString = url.url(); // "https://www.example.com/page.html?param=value"These examples demonstrate some of the features and capabilities of the KURL protocol, which can be used for efficient and reliable URL manipulation in C++ applications. The package library for KURL is KDE Frameworks.