当前位置: 首页>>代码示例>>C++>>正文


C++ QWebFrame::page方法代码示例

本文整理汇总了C++中QWebFrame::page方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebFrame::page方法的具体用法?C++ QWebFrame::page怎么用?C++ QWebFrame::page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWebFrame的用法示例。


在下文中一共展示了QWebFrame::page方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: page

QWebPage* QWebFrameProto::page() const
{
  scriptDeprecated("QWebFrame will not be available in future versions");
  QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject());
  if (item)
    return item->page();
  return 0;
}
开发者ID:xtuple,项目名称:qt-client,代码行数:8,代码来源:qwebframeproto.cpp

示例2: cookieJar

static QNetworkCookieJar* cookieJar(QObject* originatingFrame)
{
    if (!originatingFrame)
        return 0;
    QWebFrame* frame = qobject_cast<QWebFrame*>(originatingFrame);
    if (!frame)
        return 0;
    QNetworkAccessManager* manager = frame->page()->networkAccessManager();
    QNetworkCookieJar* jar = manager->cookieJar();
    return jar;
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:11,代码来源:ThirdPartyCookiesQt.cpp

示例3:

static QNetworkCookieJar *cookieJar(const Document *document)
{
    Frame *frame = document->frame();
    if (!frame)
        return 0;
    FrameLoader *loader = frame->loader();
    if (!loader)
        return 0;
    QWebFrame* webFrame = static_cast<FrameLoaderClientQt*>(loader->client())->webFrame();
    QWebPage* page = webFrame->page();
    QNetworkAccessManager* manager = page->networkAccessManager();
    QNetworkCookieJar* jar = manager->cookieJar();
    return jar;
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:14,代码来源:CookieJarQt.cpp

示例4: drtDescriptionSuitableForTestResult

// Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
{
    QWebFrame* frame = QWebFramePrivate::kit(_frame);
    QString name = frame->frameName();

    bool isMainFrame = frame == frame->page()->mainFrame();
    if (isMainFrame) {
        if (!name.isEmpty())
            return QString::fromLatin1("main frame \"%1\"").arg(name);
        return QLatin1String("main frame");
    } else {
        if (!name.isEmpty())
            return QString::fromLatin1("frame \"%1\"").arg(name);
        return QLatin1String("frame (anonymous)");
    }
}
开发者ID:Marforius,项目名称:qt,代码行数:17,代码来源:FrameLoaderClientQt.cpp

示例5: slotMainFrameLoadFinished

void KWebKitPart::slotMainFrameLoadFinished (bool ok)
{
    if (!ok || !m_doLoadFinishedActions)
        return;

    m_doLoadFinishedActions = false;

    if (!m_emitOpenUrlNotify) {
        m_emitOpenUrlNotify = true; // Save history once page loading is done.
    }

    // If the document contains no <title> tag, then set it to the current url.
    if (m_webView->title().trimmed().isEmpty()) {
        // If the document title is empty, then set it to the current url
        const QUrl url (m_webView->url());
        const QString caption (url.toString((QUrl::RemoveQuery|QUrl::RemoveFragment)));
        emit setWindowCaption(caption);

        // The urlChanged signal is emitted if and only if the main frame
        // receives the title of the page so we manually invoke the slot as a
        // work around here for pages that do not contain it, such as text
        // documents...
        slotUrlChanged(url);
    }

   QWebFrame* frame = page()->mainFrame();

    if (!frame || frame->url() == *globalBlankUrl)
        return;

    // Set the favicon specified through the <link> tag...
    if (WebKitSettings::self()->favIconsEnabled()
        && !frame->page()->settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) {
        const QWebElement element = frame->findFirstElement(QL1S("head>link[rel=icon], "
                                                                 "head>link[rel=\"shortcut icon\"]"));
        QUrl shortcutIconUrl;
        if (!element.isNull()) {
            shortcutIconUrl = frame->baseUrl().resolved(QUrl(element.attribute("href")));
            //kDebug() << "setting favicon to" << shortcutIconUrl;
            m_browserExtension->setIconUrl(shortcutIconUrl);
        }
    }

    slotFrameLoadFinished(ok);
}
开发者ID:KDE,项目名称:kwebkitpart,代码行数:45,代码来源:kwebkitpart.cpp

示例6: set_repaint_throttle

bool PropertyChanger::set_repaint_throttle(QString value)
{
	QWebFrame* pFrame = static_cast < QWebFrame* >  ( this->parent() );
	QWebPage* pPage = NULL;

	if ( pFrame != NULL )
		pPage = pFrame->page();
	else
		return false;

	if ( pPage == NULL )
		return false;

//TODO: check values
	pPage->setProperty("_q_RepaintThrottlingPreset", value);

	return true;
}
开发者ID:jpoetker,项目名称:mlbrowser,代码行数:18,代码来源:mlpropertychanger.cpp

示例7: slotLoadFinished

void KWebKitPart::slotLoadFinished(bool ok)
{
    bool pending = false;

    if (m_doLoadFinishedActions) {
        updateActions();
        QWebFrame* frame = (page() ? page()->currentFrame() : 0);
        if (ok &&
            frame == page()->mainFrame() &&
            !frame->findFirstElement(QL1S("head>meta[http-equiv=refresh]")).isNull()) {
            if (WebKitSettings::self()->autoPageRefresh()) {
                pending = true;
            } else {
                frame->page()->triggerAction(QWebPage::StopScheduledPageRefresh);
            }
        }
    }

    emit completed ((ok && pending));
}
开发者ID:KDE,项目名称:kwebkitpart,代码行数:20,代码来源:kwebkitpart.cpp

示例8: cancelRequestsForPermission

void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionContext* context)
{
    m_cachedPermissions.remove(context);

    QHash<ScriptExecutionContext*, CallbacksInfo >::iterator iter = m_pendingPermissionRequests.find(context);
    if (iter == m_pendingPermissionRequests.end())
        return;

    QWebFrame* frame = iter.value().m_frame;
    if (!frame)
        return;
    QWebPage* page = frame->page();
    m_pendingPermissionRequests.erase(iter);

    if (!page)
        return;

    if (dumpNotification)
        printf("DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData());

    emit page->featurePermissionRequestCanceled(frame, QWebPage::Notifications);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:22,代码来源:NotificationPresenterClientQt.cpp


注:本文中的QWebFrame::page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。