Qt&Qml打开外部资源
- Qt方法
QDesktopServices::openUrl(url);
QDesktopServices::openUrl(QUrl("https://blog.csdn.net"));
QDesktopServices::openUrl(QUrl::formLocalFile("file:///C:/index.html"));
- Qml方法
Qt.openUrlExternally(url);
Qt.openUrlExternally("https://blog.csdn.net");
Qt.openUrlExternally("file:///C:/index.html");