QUrl is a class provided in the Qt library, which is a cross-platform application development framework for C++. QUrl is used to represent URL addresses and provides a convenient way to manipulate URLs.
One of the features of QUrl is the fileName function, which returns only the name of a file in a URL address. For example:
```c++
#include
#include
int main()
{
QUrl url("https://example.com/documents/report.pdf");
QString fileName = url.fileName();
// fileName = "report.pdf"
return 0;
}
```
In this example, a QUrl object is created with a URL address that has a file named "report.pdf". The fileName function is called to retrieve only the file name and assign it to a QString variable.
The QUrl library is part of the Qt package, which is a popular C++ library for building GUI applications.
C++ (Cpp) QUrl::fileName - 30 examples found. These are the top rated real world C++ (Cpp) examples of QUrl::fileName extracted from open source projects. You can rate examples to help us improve the quality of examples.