KUrl url("http://www.example.com"); url.addQueryItem("key", "value");
KUrl url("http://www.example.com/path/file.html?existingKey=value"); url.addQueryItem("newKey", "newValue");This code adds a new query item "newKey=newValue" to the URL "http://www.example.com/path/file.html?existingKey=value". The result would be "http://www.example.com/path/file.html?existingKey=value&newKey=newValue". These code examples are using the KDE Development Platform library, specifically the KUrl class.