Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0, 5.9.1
-
Windows XP, macOS 10.12
-
d90fb72c201efde8f9fc10c4fb4a542b1a26b9e8 7e89e6bfe8 (qt/qtbase/dev) 7e89e6bfe8 (qt/tqtc-qtbase/dev)
Description
The fragment is discarded when the scheme is set to "file", when using QDesktopServices::openUrl().
If you copy this local address with the anchor into the browser, it works, meaning that the anchor (fragment) could be passed to the application, but is not.
example
#include <QtGui> int main (int argc, char **argv) { QApplication a(argc, argv); QString site("file:///C:/Qt/4.7.0/doc/html/qurl.html"); QUrl url(site, QUrl::TolerantMode); url.setFragment("host"); qWarning(QString(" URL: %1").arg(url.toString()).toStdString().c_str()); QDesktopServices::openUrl(url); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-7827 Mac : QDesktopServices::openUrl() ignores anchor on local files.
-
- Closed
-
-
QTBUG-55300 QDesktopServices::openUrl() ignores URL's fragment
-
- Closed
-