diff options
Diffstat (limited to 'Source/WebKit/qt/Api/qwebframe.cpp')
-rw-r--r-- | Source/WebKit/qt/Api/qwebframe.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp index dce0137..6f98bca 100644 --- a/Source/WebKit/qt/Api/qwebframe.cpp +++ b/Source/WebKit/qt/Api/qwebframe.cpp @@ -554,6 +554,7 @@ QWebFrame::~QWebFrame() Qt properties will be exposed as JavaScript properties and slots as JavaScript methods. + The interaction between C++ and JavaScript is explained in the documentation of the \l{The QtWebKit Bridge}{QtWebKit bridge}. If you want to ensure that your QObjects remain accessible after loading a new URL, you should add them in a slot connected to the @@ -578,6 +579,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object Qt properties will be exposed as JavaScript properties and slots as JavaScript methods. + The interaction between C++ and JavaScript is explained in the documentation of the \l{The QtWebKit Bridge}{QtWebKit bridge}. If you want to ensure that your QObjects remain accessible after loading a new URL, you should add them in a slot connected to the @@ -732,7 +734,15 @@ static inline QUrl ensureAbsoluteUrl(const QUrl &url) if (!url.isRelative()) return url; - return QUrl::fromLocalFile(QFileInfo(url.toLocalFile()).absoluteFilePath()); + // This contains the URL with absolute path but without + // the query and the fragment part. + QUrl baseUrl = QUrl::fromLocalFile(QFileInfo(url.toLocalFile()).absoluteFilePath()); + + // The path is removed so the query and the fragment parts are there. + QString pathRemoved = url.toString(QUrl::RemovePath); + QUrl toResolve(pathRemoved); + + return baseUrl.resolved(toResolve); } /*! |