In this example, we create a KUrl object representing a file path, and then use the `fileName()` method to get just the file name from the path. The result will be a QString containing "myfile.txt". Example 2: Setting the path of a KUrl objectcpp KUrl myUrl("https://www.example.com/"); // create KUrl object myUrl.setPath("/newpage.html"); // set new path ``` In this example, we create a KUrl object representing a web address, and then use the `setPath()` method to change the path to a different page on the same site. The resulting URL will be "https://www.example.com/newpage.html". Package library: KDE Libraries (kdelibs)