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
For Gerrit Dashboard: QTBUG-14460 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
429033,1 | Windows QPA/QPlatformServices::openUrl(): Add work around for anchors on local file URLs | 6.3 | qt/qtbase | Status: NEW | +2 | 0 |
429037,1 | Windows QPA/QPlatformServices::openUrl(): Add work around for anchors on local file URLs | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | -1 | 0 |
429078,2 | Windows QPA/QPlatformServices::openUrl(): Add work around for anchors on local file URLs | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |