本文整理汇总了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 ();
}
示例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;
}