diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp
index d8726a99cb57c5e1d0d6213f3ef3d1bf636413b1..a88393c66574c795eb3c9505283162a04d68f995 100644
--- a/src/plugins/help/helpviewer.cpp
+++ b/src/plugins/help/helpviewer.cpp
@@ -109,10 +109,11 @@ bool HelpViewer::canOpenPage(const QString &url)
     return !mimeFromUrl(url).isEmpty();
 }
 
-QString HelpViewer::mimeFromUrl(const QString &url)
+QString HelpViewer::mimeFromUrl(const QUrl &url)
 {
-    const int index = url.lastIndexOf(QLatin1Char('.'));
-    const QByteArray &ext = url.mid(index).toUtf8().toLower();
+    const QString &path = url.path();
+    const int index = path.lastIndexOf(QLatin1Char('.'));
+    const QByteArray &ext = path.mid(index).toUtf8().toLower();
 
     const ExtensionMap *e = extensionMap;
     while (e->extension) {
diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h
index d49f3d1e1404c12ef8d04e002ffcb415fd27f3b1..45c33e95d95deb401190382828373e91f08aa3e7 100644
--- a/src/plugins/help/helpviewer.h
+++ b/src/plugins/help/helpviewer.h
@@ -91,7 +91,7 @@ public:
 
     static bool isLocalUrl(const QUrl &url);
     static bool canOpenPage(const QString &url);
-    static QString mimeFromUrl(const QString &url);
+    static QString mimeFromUrl(const QUrl &url);
     static bool launchWithExternalApp(const QUrl &url);
 
 public slots: