本文整理汇总了C++中FrameLoader::originalRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameLoader::originalRequest方法的具体用法?C++ FrameLoader::originalRequest怎么用?C++ FrameLoader::originalRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameLoader
的用法示例。
在下文中一共展示了FrameLoader::originalRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestedUrl
/*!
\since 4.6
\property QWebFrame::requestedUrl
The URL requested to loaded by the frame currently viewed. The URL may differ from
the one returned by url() if a DNS resolution or a redirection occurs.
\sa url(), setUrl()
*/
QUrl QWebFrame::requestedUrl() const
{
// There are some possible edge cases to be handled here,
// apart from checking if activeDocumentLoader is valid:
//
// * Method can be called while processing an unsucessful load.
// In this case, frameLoaderClient will hold the current error
// (m_loadError), and we will make use of it to recover the 'failingURL'.
// * If the 'failingURL' holds a null'ed string though, we fallback
// to 'outgoingReferrer' (it yet is safer than originalRequest).
FrameLoader* loader = d->frame->loader();
FrameLoaderClientQt* loaderClient = d->frameLoaderClient;
if (!loader->activeDocumentLoader()
|| !loaderClient->m_loadError.isNull()) {
if (!loaderClient->m_loadError.failingURL().isNull())
return QUrl(loaderClient->m_loadError.failingURL());
else if (!loader->outgoingReferrer().isEmpty())
return QUrl(loader->outgoingReferrer());
}
return loader->originalRequest().url();
}