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


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

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


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

示例1: loadDefaults

void SettingsDialog::loadDefaults()
{
    QWebSettings *defaultSettings = QWebSettings::globalSettings();
    QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
    int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
    m_standardFont = QFont(standardFontFamily, standardFontSize);
    standardLabel->setText(QString(QLatin1String("%1 %2")).arg(m_standardFont.family()).arg(m_standardFont.pointSize()));

    QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
    int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
    m_fixedFont = QFont(fixedFontFamily, fixedFontSize);
    fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(m_fixedFont.family()).arg(m_fixedFont.pointSize()));

    downloadsLocation->setText(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));

    blockPopupWindows->setChecked(!defaultSettings->testAttribute(QWebSettings::JavascriptCanOpenWindows));
    enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled));
    enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled));
    enableImages->setChecked(defaultSettings->testAttribute(QWebSettings::AutoLoadImages));
    clickToFlash->setChecked(false);
    cookieSessionCombo->setCurrentIndex(0);
    filterTrackingCookiesCheckbox->setChecked(false);

    autoFillPasswordFormsCheckBox->setChecked(false);
    minimFontSizeCheckBox->setChecked(false);
    minimumFontSizeSpinBox->setValue(9);
}
开发者ID:bukka,项目名称:arora,代码行数:27,代码来源:settings.cpp

示例2: updateWindowTitle

void MainWindow::updateWindowTitle(const QString &title)
{
    QWebSettings *settings = QWebSettings::globalSettings();
    if (title.isEmpty())
    {
        if (settings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        {
            setWindowTitle(i18nc("Window title when private browsing is activated", "rekonq (Private Browsing)"));
        }
        else
        {
            setWindowTitle("rekonq");
        }
    }
    else
    {
        if (settings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        {
            setWindowTitle(i18nc("window title, %1 = title of the active website", "%1 – rekonq (Private Browsing)", title));
        }
        else
        {
            setWindowTitle(i18nc("window title, %1 = title of the active website", "%1 – rekonq", title));
        }
    }
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:26,代码来源:mainwindow.cpp

示例3: updateRow

void DownloadManager::updateRow()
{
    DownloadItem *item = qobject_cast<DownloadItem*>(sender());
    int row = m_downloads.indexOf(item);
    if (-1 == row)
        return;
    if (!m_iconProvider)
        m_iconProvider = new QFileIconProvider();
    QIcon icon = m_iconProvider->icon(item->m_output.fileName());
    if (icon.isNull())
        icon = style()->standardIcon(QStyle::SP_FileIcon);
    item->fileIcon->setPixmap(icon.pixmap(48, 48));
    downloadsView->setRowHeight(row, item->minimumSizeHint().height());

    bool remove = false;
    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (!item->downloading()
        && globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        remove = true;

    if (item->downloadedSuccessfully()
        && removePolicy() == DownloadManager::SuccessFullDownload) {
        remove = true;
    }
    if (remove)
        m_model->removeRow(row);

    cleanupButton->setEnabled(m_downloads.count() - activeDownloads() > 0);
}
开发者ID:dfizban,项目名称:remixos-usb-tool,代码行数:29,代码来源:downloadmanager.cpp

示例4: searchNow

void ToolbarSearch::searchNow()
{
    QString searchText = lineEdit()->text();
    QStringList newList = m_stringListModel->stringList();
    if (newList.contains(searchText))
        newList.removeAt(newList.indexOf(searchText));
    newList.prepend(searchText);
    if (newList.size() >= m_maxSavedSearches)
        newList.removeLast();

    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (!globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) {
        m_stringListModel->setStringList(newList);
        m_autosaver->changeOccurred();
    }

    QUrl url(QLatin1String("http://www.google.com/search"));
    QUrlQuery urlQuery;
    urlQuery.addQueryItem(QLatin1String("q"), searchText);
    urlQuery.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8"));
    urlQuery.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8"));
    urlQuery.addQueryItem(QLatin1String("client"), QLatin1String("qtdemobrowser"));
    url.setQuery(urlQuery);
    emit search(url);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:25,代码来源:toolbarsearch.cpp

示例5: saveSession

void BrowserApplication::saveSession()
{
    if (quiting)
        return;
    QSettings settings;
    settings.beginGroup(QLatin1String("MainWindow"));
    settings.setValue(QLatin1String("restoring"), false);
    settings.endGroup();

    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        return;

    clean();

    settings.beginGroup(QLatin1String("sessions"));

    int version = 2;

    QByteArray data;
    QBuffer buffer(&data);
    QDataStream stream(&buffer);
    buffer.open(QIODevice::WriteOnly);

    stream << qint32(BrowserApplicationMagic);
    stream << qint32(version);

    stream << qint32(m_mainWindows.count());
    for (int i = 0; i < m_mainWindows.count(); ++i)
        stream << m_mainWindows.at(i)->saveState();
    settings.setValue(QLatin1String("lastSession"), data);
    settings.endGroup();
}
开发者ID:lmax,项目名称:arora,代码行数:33,代码来源:browserapplication.cpp

示例6: destroy

void Manitou::destroy()
{
    QSettings settings;
    QWebSettings *globalSettings = QWebSettings::globalSettings();
    settings.beginGroup("WebKit");
        settings.setValue("AutoLoadImages", globalSettings->testAttribute(QWebSettings::AutoLoadImages));
        settings.setValue("DevelopersExtras", globalSettings->testAttribute(QWebSettings::DeveloperExtrasEnabled));
        settings.setValue("Plugins", globalSettings->testAttribute(QWebSettings::PluginsEnabled));
        settings.setValue("LocalStorage", globalSettings->testAttribute(QWebSettings::LocalStorageEnabled));
        settings.setValue("LocalDatabase", globalSettings->testAttribute(QWebSettings::LocalStorageDatabaseEnabled));
    settings.endGroup();

    delete searchHistory;
    database.destroy();
    
    delete wiiRemote;
}
开发者ID:ddksaku,项目名称:manitou,代码行数:17,代码来源:Manitou.cpp

示例7: loadDefaults

void SettingsDialog::loadDefaults()
{
    QWebSettings *defaultSettings = QWebSettings::globalSettings();
    QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
    int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
    standardFont = QFont(standardFontFamily, standardFontSize);
    standardLabel->setText(QString(QLatin1String("%1 %2")).arg(standardFont.family()).arg(standardFont.pointSize()));

    QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
    int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
    fixedFont = QFont(fixedFontFamily, fixedFontSize);
    fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(fixedFont.family()).arg(fixedFont.pointSize()));

    downloadsLocation->setText(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));

    enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled));
    enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled));
}
开发者ID:mannerdev,项目名称:zeus-browser,代码行数:18,代码来源:settings.cpp

示例8: loadDefaults

void SettingsDialog::loadDefaults()
{
    QWebSettings *defaultSettings = QWebSettings::globalSettings();
    QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
    int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
    standardFont = QFont(standardFontFamily, standardFontSize);
    standardLabel->setText(QString(QLatin1String("%1 %2")).arg(standardFont.family()).arg(standardFont.pointSize()));

    QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
    int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
    fixedFont = QFont(fixedFontFamily, fixedFontSize);
    fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(fixedFont.family()).arg(fixedFont.pointSize()));

    downloadsLocation->setText(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));

    blockPopupWindows->setChecked(!defaultSettings->testAttribute(QWebSettings::JavascriptCanOpenWindows));
    enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled));
    enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled));
    enableImages->setChecked(defaultSettings->testAttribute(QWebSettings::AutoLoadImages));
    clickToFlash->setChecked(true);
}
开发者ID:porphyr,项目名称:arora,代码行数:21,代码来源:settings.cpp

示例9: addHistoryEntry

void HistoryManager::addHistoryEntry(const QString &url)
{
    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        return;

    QUrl cleanUrl(url);

    // don't store about: urls (home page related)
    if (cleanUrl.scheme() == QString("about"))
        return;

    cleanUrl.setPassword(QString());
    cleanUrl.setHost(cleanUrl.host().toLower());
    QString checkUrlString = cleanUrl.toString();

    HistoryItem item;
    
    // NOTE
    // check if the url has just been visited.
    // if so, remove previous entry from history, update and prepend it
    if(historyContains(checkUrlString))
    {
        int index = m_historyFilterModel->historyLocation(checkUrlString);
        item = m_history.at(index);
        m_history.removeOne(item);
        emit entryRemoved(item);
        
        item.dateTime = QDateTime::currentDateTime();
        item.visitCount++;
    }
    else
    {
        item = HistoryItem(checkUrlString, QDateTime::currentDateTime());
    }
    
    m_history.prepend(item);
    emit entryAdded(item);
    
    if (m_history.count() == 1)
        checkForExpired();
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:42,代码来源:historymanager.cpp

示例10: searchNow

void ToolbarSearch::searchNow()
{
    QString searchText = text();
    QStringList newList = m_recentSearches;
    if (newList.contains(searchText))
        newList.removeAt(newList.indexOf(searchText));
    newList.prepend(searchText);
    if (newList.size() >= m_maxSavedSearches)
        newList.removeLast();

    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (!globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) {
        m_recentSearches = newList;
        m_autosaver->changeOccurred();
    }

    QUrl url(QLatin1String("http://www.google.com/search"));
    url.addEncodedQueryItem(QUrl::toPercentEncoding(QLatin1String("q")),
                            QUrl::toPercentEncoding(searchText));
    url.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8"));
    url.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8"));
    url.addQueryItem(QLatin1String("client"), QCoreApplication::applicationName());
    emit search(url);
}
开发者ID:porphyr,项目名称:arora,代码行数:24,代码来源:toolbarsearch.cpp

示例11: loadDefaults

void SettingsDialog::loadDefaults()
{
    QWebSettings *defaultSettings = QWebSettings::globalSettings();
    QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
    int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
    standardFont = QFont(standardFontFamily, standardFontSize);
    standardLabel->setText(QString(QLatin1String("%1 %2")).arg(standardFont.family()).arg(standardFont.pointSize()));

    QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
    int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
    fixedFont = QFont(fixedFontFamily, fixedFontSize);
    fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(fixedFont.family()).arg(fixedFont.pointSize()));

	comboMainMenu->setCurrentIndex(0);

	downloadsLocation->setText( DefaultDownloadPath( false )  );

    enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled));
    enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled));
	blockPopups->setChecked( ! (defaultSettings->testAttribute(QWebSettings::JavascriptCanOpenWindows)) );
	autoLoadImages->setChecked(defaultSettings->testAttribute(QWebSettings::AutoLoadImages));

	enableDiskCache->setChecked(false);

	chkSavePasswords->setChecked(false);
	checkBoxDeleteDownloads->setChecked(false);

	newTabAction->setCurrentIndex(0);

	comboBoxAV->setCurrentIndex(0);

	mouseweelClick->setCurrentIndex(1);

	comboBoxStyle->addItems(QStyleFactory::keys());
	int ind = comboBoxStyle->findText(DefaultAppStyle());
	if (ind >= 0)
		comboBoxStyle->setCurrentIndex(ind);
	
	chkUserStyleSheet->setChecked(false);
	chkUserAgent->setChecked(false);
	comboAgents->setEditText("");

	chkExtViewer->setChecked(false);

	tbGoBack->setChecked( true );
	tbGoForward->setChecked( true );
	tbAddBook->setChecked( true );
	tbHome->setChecked( true );
	tbRefresh->setChecked( true );
	tbAppStyle->setChecked( true );
	tbPrivMode->setChecked( true );
	tbPrefs->setChecked( true );
	tbImages->setChecked( false );
	tbProxy->setChecked( false );
	proxyExcept->setChecked(false);
	tbCompatibility->setChecked( true );
	tbReset->setChecked( false );

#ifndef Q_WS_WIN
	proxyAuto->setVisible(false);
#endif

	tbInspect->setChecked( false );
	tbVirtKeyb->setChecked( false );
	tbBookmarks->setChecked( false );
	tbTextSize->setChecked( false );

	expireHistory->setCurrentIndex(1);

	chkBlockAds->setChecked(false);
	listAds->clear();

	chkBlockAdsEx->setChecked(false);
	listAdEx->clear();
}
开发者ID:OS2World,项目名称:APP-INTERNET-QtWeb,代码行数:75,代码来源:settings.cpp


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