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


C++ KConfigBase::readNumEntry方法代码示例

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


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

示例1: readAndApplyTextSettings

// private
void kpMainWindow::readAndApplyTextSettings ()
{
    KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupText);
    KConfigBase *cfg = cfgGroupSaver.config ();

    m_actionTextFontFamily->setFont (cfg->readEntry (kpSettingFontFamily, QString::fromLatin1 ("Times")));
    m_actionTextFontSize->setFontSize (cfg->readNumEntry (kpSettingFontSize, 14));
    m_actionTextBold->setChecked (cfg->readBoolEntry (kpSettingBold, false));
    m_actionTextItalic->setChecked (cfg->readBoolEntry (kpSettingItalic, false));
    m_actionTextUnderline->setChecked (cfg->readBoolEntry (kpSettingUnderline, false));
    m_actionTextStrikeThru->setChecked (cfg->readBoolEntry (kpSettingStrikeThru, false));

    m_textOldFontFamily = m_actionTextFontFamily->font ();
    m_textOldFontSize = m_actionTextFontSize->fontSize ();
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:16,代码来源:kpmainwindow_text.cpp

示例2: load

bool HostConfig::load( KConfigBase &config )
{
    name = config.readEntry( "Host" );
    if ( name.isEmpty() )
        return false;

    port = config.readNumEntry( "Port", defaultSnmpPort() );

    bool ok = false;
    version = stringToSnmpVersion( config.readEntry( "Version" ), &ok );
    if ( !ok )
        return false;

    if ( version != SnmpVersion3 ) {
        community = config.readEntry( "Community" );
        return true;
    }

    securityName = config.readEntry( "SecurityName" );

    securityLevel = stringToSecurityLevel( config.readEntry( "SecurityLevel" ), &ok );
    if ( !ok )
        return false;

    if ( securityLevel == NoAuthPriv )
        return true;

    authentication.protocol = stringToAuthenticationProtocol( config.readEntry( "AuthType" ), &ok );
    if ( !ok )
        return false;
    authentication.key = KStringHandler::obscure( config.readEntry( "AuthPassphrase" ) );

    if ( securityLevel == AuthNoPriv )
        return true;

    privacy.protocol = stringToPrivacyProtocol( config.readEntry( "PrivType" ), &ok );
    if ( !ok )
        return false;
    privacy.key = KStringHandler::obscure( config.readEntry( "PrivPassphrase" ) );

    return true;
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:42,代码来源:hostconfig.cpp


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