#include <QtCore/QCoreApplication>#include <QUrl>#include <QDebug>int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QUrl url("file:///C:/WINDOWS/explorer.exe"); qDebug() << url.path(); return a.exec();}
C++ (Qt)QUrl url(...);QString path = url.toLocalFile();
C++ (Qt) QUrl url("http://www.ru/test"); qDebug() << url.path(); output: "/test"