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


C++ QWebSettings::setPluginSupplementalPath方法代码示例

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


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

示例1: initWebSettings


//.........这里部分代码省略.........
        globalWebSettings->setAttribute(QWebSettings::JavascriptCanCloseWindows, settings.value(WEB_SETTINGS_KEY_JAVASCRIPT_CAN_CLOSE_WINDOWS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_JAVASCRIPT_CAN_ACCESS_CLIPBOARD))
        globalWebSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, settings.value(WEB_SETTINGS_KEY_JAVASCRIPT_CAN_ACCESS_CLIPBOARD).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_DEVELOPER_EXTRAS))
        globalWebSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, settings.value(WEB_SETTINGS_KEY_DEVELOPER_EXTRAS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_SPACIAL_NAVIGATION))
        globalWebSettings->setAttribute(QWebSettings::SpatialNavigationEnabled, settings.value(WEB_SETTINGS_KEY_SPACIAL_NAVIGATION).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_LINKS_INCLUDED_IN_FOCUS_CHAIN))
        globalWebSettings->setAttribute(QWebSettings::LinksIncludedInFocusChain, settings.value(WEB_SETTINGS_KEY_LINKS_INCLUDED_IN_FOCUS_CHAIN).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_ZOOM_TEXT_ONLY))
        globalWebSettings->setAttribute(QWebSettings::ZoomTextOnly, settings.value(WEB_SETTINGS_KEY_ZOOM_TEXT_ONLY).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_PRINT_ELEMENT_BACKGROUNDS))
        globalWebSettings->setAttribute(QWebSettings::PrintElementBackgrounds, settings.value(WEB_SETTINGS_KEY_PRINT_ELEMENT_BACKGROUNDS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_OFFLINE_STORAGE_DATABASE)) {
        bool offlineStorageDatabaseEnabled = settings.value(WEB_SETTINGS_KEY_OFFLINE_STORAGE_DATABASE).toBool();
        globalWebSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, offlineStorageDatabaseEnabled);
        if (offlineStorageDatabaseEnabled && settings.contains(WEB_SETTINGS_KEY_OFFLINE_STORAGE_DATABASE_PATH))
            globalWebSettings->setOfflineStoragePath(settings.value(WEB_SETTINGS_KEY_OFFLINE_STORAGE_DATABASE_PATH).toString());
    }

    if (settings.contains(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_CACHE)) {
        bool offlineWebApplicationCachedEnabled = settings.value(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_CACHE).toBool();
        globalWebSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, offlineWebApplicationCachedEnabled);
        if (offlineWebApplicationCachedEnabled && settings.contains(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_CACHE_PATH))
            globalWebSettings->setOfflineWebApplicationCachePath(settings.value(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_CACHE_PATH).toString());
    }

    if (settings.contains(WEB_SETTINGS_KEY_LOCAL_STORAGE)) {
        bool localStorageEnabled = settings.value(WEB_SETTINGS_KEY_LOCAL_STORAGE).toBool();
        globalWebSettings->setAttribute(QWebSettings::LocalStorageEnabled, localStorageEnabled);
        if (localStorageEnabled && settings.contains(WEB_SETTINGS_KEY_LOCAL_STORAGE_PATH))
            globalWebSettings->setLocalStoragePath(settings.value(WEB_SETTINGS_KEY_LOCAL_STORAGE_PATH).toString());
    }

    if (settings.contains(WEB_SETTINGS_KEY_LOCAL_CONTENT_CAN_ACCESS_REMOTE_URLS))
        globalWebSettings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, settings.value(WEB_SETTINGS_KEY_LOCAL_CONTENT_CAN_ACCESS_REMOTE_URLS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_LOCAL_CONTENT_CAN_ACCESS_FILE_URLS))
        globalWebSettings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, settings.value(WEB_SETTINGS_KEY_LOCAL_CONTENT_CAN_ACCESS_FILE_URLS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_XSS_AUDITING))
        globalWebSettings->setAttribute(QWebSettings::XSSAuditingEnabled, settings.value(WEB_SETTINGS_KEY_XSS_AUDITING).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_ACCELERATED_COMPOSITING))
        globalWebSettings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, settings.value(WEB_SETTINGS_KEY_ACCELERATED_COMPOSITING).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_WEBGL))
        globalWebSettings->setAttribute(QWebSettings::WebGLEnabled, settings.value(WEB_SETTINGS_KEY_WEBGL).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_TILE_BACKING_STORE))
        globalWebSettings->setAttribute(QWebSettings::TiledBackingStoreEnabled, settings.value(WEB_SETTINGS_KEY_TILE_BACKING_STORE).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_FRAME_FLATTENING))
        globalWebSettings->setAttribute(QWebSettings::FrameFlatteningEnabled, settings.value(WEB_SETTINGS_KEY_FRAME_FLATTENING).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_SITE_SPECIFIC_QUIRKS))
        globalWebSettings->setAttribute(QWebSettings::SiteSpecificQuirksEnabled, settings.value(WEB_SETTINGS_KEY_SITE_SPECIFIC_QUIRKS).toBool());

    if (settings.contains(WEB_SETTINGS_KEY_MAX_PAGES_IN_CACHE))
        globalWebSettings->setMaximumPagesInCache(settings.value(WEB_SETTINGS_KEY_MAX_PAGES_IN_CACHE).toInt());

    if (settings.contains(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_MIN) 
            && settings.contains(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_MAX) 
            && settings.contains(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_OVERALL)) {
        globalWebSettings->setObjectCacheCapacities(
            stringToBytes(settings.value(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_MIN).toString()),
            stringToBytes(settings.value(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_MAX).toString()),
            stringToBytes(settings.value(WEB_SETTINGS_KEY_OBJ_CACHE_CAPACITY_OVERALL).toString()));
    }

    if (settings.contains(WEB_SETTINGS_KEY_OFFLINE_STORAGE_QUOTA))
        globalWebSettings->setOfflineStorageDefaultQuota(stringToBytes(settings.value(WEB_SETTINGS_KEY_OFFLINE_STORAGE_QUOTA).toString()));

    if (settings.contains(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_QUOTA))
        globalWebSettings->setOfflineStorageDefaultQuota(stringToBytes(settings.value(WEB_SETTINGS_KEY_OFFLINE_WEBAPP_QUOTA).toString()));

    QStringList supplementalPath;

    if (settings.contains(WEB_SETTINGS_KEY_PLUGIN_SUPPLEMENTAL_PATH))
        supplementalPath.append(settings.value(WEB_SETTINGS_KEY_PLUGIN_SUPPLEMENTAL_PATH).toString());

    if (settings.contains(WEB_SETTINGS_KEY_PLUGIN_SUPPLEMENTAL_USER_PATH))
        supplementalPath.append(settings.value(WEB_SETTINGS_KEY_PLUGIN_SUPPLEMENTAL_USER_PATH).toString());
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
    if (!supplementalPath.isEmpty())
        globalWebSettings->setPluginSupplementalPath(supplementalPath.join(QLatin1String(":")));

    if (settings.contains(WEB_SETTINGS_KEY_FULLSCREEN_API))
        globalWebSettings->setAttribute(QWebSettings::FullScreenEnabled, settings.value(WEB_SETTINGS_KEY_FULLSCREEN_API).toBool());
#endif

    return true;
}
开发者ID:ericblade-owo,项目名称:WebKitSupplemental,代码行数:101,代码来源:weboswebsettings.cpp


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