本文整理汇总了C++中KConfig::readFontEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readFontEntry方法的具体用法?C++ KConfig::readFontEntry怎么用?C++ KConfig::readFontEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readFontEntry方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintStyle
DetailledPrintStyle::DetailledPrintStyle( PrintingWizard *parent, const char *name )
: PrintStyle( parent, name ),
mPageAppearance( new AppearancePage( parent, "AppearancePage" ) ),
mPainter( 0 ),
mPrintProgress( 0 )
{
KConfig *config;
QFont font;
bool kdeFonts;
QFont standard = KGlobalSettings::generalFont();
QFont fixed = KGlobalSettings::fixedFont();
setPreview( "detailed-style.png" );
addPage( mPageAppearance, i18n( "Detailed Print Style - Appearance" ) );
config = kapp->config();
config->setGroup( ConfigSectionName );
kdeFonts = config->readBoolEntry( UseKDEFonts, true );
mPageAppearance->cbStandardFonts->setChecked( kdeFonts );
font = config->readFontEntry( HeaderFont, &standard );
mPageAppearance->kfcHeaderFont->setCurrentFont( font.family() );
mPageAppearance->kisbHeaderFontSize->setValue( font.pointSize() );
font = config->readFontEntry( HeadlinesFont, &standard );
mPageAppearance->kfcHeadlineFont->setCurrentFont( font.family() );
mPageAppearance->kisbHeadlineFontSize->setValue( font.pointSize() );
font = config->readFontEntry( BodyFont, &standard );
mPageAppearance->kfcBodyFont->setCurrentFont( font.family() );
mPageAppearance->kisbBodyFontSize->setValue( font.pointSize() );
font = config->readFontEntry( DetailsFont, &standard );
mPageAppearance->kfcDetailsFont->setCurrentFont( font.family() );
mPageAppearance->kisbDetailsFontSize->setValue( font.pointSize() );
font = config->readFontEntry( FixedFont, &fixed );
mPageAppearance->kfcFixedFont->setCurrentFont( font.family() );
mPageAppearance->kisbFixedFontSize->setValue( font.pointSize() );
mPageAppearance->cbBackgroundColor->setChecked(
config->readBoolEntry( ColoredContactHeaders, true ) );
mPageAppearance->kcbHeaderBGColor->setColor(
config->readColorEntry( ContactHeaderBGColor, &Qt::black ) );
mPageAppearance->kcbHeaderTextColor->setColor(
config->readColorEntry( ContactHeaderForeColor, &Qt::white ) );
mPageAppearance->layout()->setMargin( KDialog::marginHint() );
mPageAppearance->layout()->setSpacing( KDialog::spacingHint() );
}
示例2: QTextEdit
ProtocolView::ProtocolView(const QCString& appId, QWidget *parent, const char *name)
: QTextEdit(parent, name)
, job(0)
, m_isUpdateJob(false)
{
setReadOnly(true);
setUndoRedoEnabled(false);
setTabChangesFocus(true);
setTextFormat(Qt::LogText);
KConfig *config = CervisiaPart::config();
config->setGroup("LookAndFeel");
setFont(config->readFontEntry("ProtocolFont"));
config->setGroup("Colors");
QColor defaultColor = QColor(255, 130, 130);
conflictColor=config->readColorEntry("Conflict",&defaultColor);
defaultColor=QColor(130, 130, 255);
localChangeColor=config->readColorEntry("LocalChange",&defaultColor);
defaultColor=QColor(70, 210, 70);
remoteChangeColor=config->readColorEntry("RemoteChange",&defaultColor);
// create a DCOP stub for the non-concurrent cvs job
job = new CvsJob_stub(appId, "NonConcurrentJob");
// establish connections to the signals of the cvs job
connectDCOPSignal(job->app(), job->obj(), "jobExited(bool, int)",
"slotJobExited(bool, int)", true);
connectDCOPSignal(job->app(), job->obj(), "receivedStdout(QString)",
"slotReceivedOutput(QString)", true);
connectDCOPSignal(job->app(), job->obj(), "receivedStderr(QString)",
"slotReceivedOutput(QString)", true);
}
示例3: createGlobalSettingsPage
void KDevIDEExtension::createGlobalSettingsPage(KDialogBase *dlg)
{
KConfig* config = kapp->config();
QVBox *vbox = dlg->addVBoxPage(i18n("General"), i18n("General"), BarIcon("kdevelop", KIcon::SizeMedium) );
gsw = new SettingsWidget(vbox, "general settings widget");
gsw->projectsURL->setMode((int)KFile::Directory);
config->setGroup("General Options");
gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true));
gsw->outputFont->setFont( config->readFontEntry( "OutputViewFont" ) );
config->setGroup("MakeOutputView");
gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true));
gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false));
gsw->compileOutputCombo->setCurrentItem(config->readNumEntry("CompilerOutputLevel",2));
gsw->forceCLocaleRadio->setChecked( config->readBoolEntry( "ForceCLocale", true ) );
gsw->userLocaleRadio->setChecked( !config->readBoolEntry( "ForceCLocale", true ) );
config->setGroup("General Options");
gsw->projectsURL->setURL(config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/"));
gsw->designerButtonGroup->setButton( config->readNumEntry( "DesignerApp", 0 ) );
QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
gsw->qtDesignerRadioButton->setChecked( DesignerSetting == "ExternalDesigner" );
gsw->seperateAppRadioButton->setChecked( DesignerSetting == "ExternalKDevDesigner" );
gsw->embeddedDesignerRadioButton->setChecked( DesignerSetting == "EmbeddedKDevDesigner" );
config->setGroup("TerminalEmulator");
gsw->terminalEdit->setText( config->readEntry( "TerminalApplication", QString::fromLatin1("konsole") ) );
bool useKDESetting = config->readBoolEntry( "UseKDESetting", true );
gsw->useKDETerminal->setChecked( useKDESetting );
gsw->useOtherTerminal->setChecked( !useKDESetting );
}
示例4: defFont
KPager::KPager(KPagerMainWindow *parent, const char *name)
: QFrame (parent, name, WStyle_Customize | WStyle_NoBorder | WStyle_Tool)
, m_layout(0)
, m_mnu(0)
, m_smnu(0)
, m_dmnu(0)
{
m_windows.setAutoDelete(true); // delete windows info after removal
setBackgroundColor( black );
m_winmodule=new KWinModule(this);
m_currentDesktop=m_winmodule->currentDesktop();
m_grabWinTimer=new QTimer(this,"grabWinTimer");
connect(m_grabWinTimer, SIGNAL(timeout()), this, SLOT(slotGrabWindows()));
KPagerConfigDialog::initConfiguration();
KConfig *cfg = kapp->config();
cfg->setGroup("KPager");
m_showStickyOption=cfg->readBoolEntry("ShowStickyOption",false);
int numberOfDesktops=m_winmodule->numberOfDesktops();
for (int i=0;i<numberOfDesktops;i++)
{
Desktop *dsk=new Desktop(i+1,m_winmodule->desktopName(i),this);
m_desktops.append(dsk);
}
m_layoutType=static_cast<enum KPager::LayoutTypes>( KPagerConfigDialog::m_layoutType );
connect( m_winmodule, SIGNAL( activeWindowChanged(WId)),
SLOT(slotActiveWindowChanged(WId)));
connect( m_winmodule, SIGNAL( windowAdded(WId) ),
SLOT( slotWindowAdded(WId) ) );
connect( m_winmodule, SIGNAL( windowRemoved(WId) ),
SLOT( slotWindowRemoved(WId) ) );
connect( m_winmodule, SIGNAL( windowChanged(WId,unsigned int) ),
SLOT( slotWindowChanged(WId,unsigned int) ) );
connect( m_winmodule, SIGNAL( stackingOrderChanged() ),
SLOT( slotStackingOrderChanged() ) );
connect( m_winmodule, SIGNAL( desktopNamesChanged() ),
SLOT( slotDesktopNamesChanged() ) );
connect( m_winmodule, SIGNAL( numberOfDesktopsChanged(int) ),
SLOT( slotNumberOfDesktopsChanged(int) ) );
connect( m_winmodule, SIGNAL( currentDesktopChanged(int)),
SLOT( slotCurrentDesktopChanged(int) ) );
connect(kapp, SIGNAL(backgroundChanged(int)),
SLOT(slotBackgroundChanged(int)));
QFont defFont(KGlobalSettings::generalFont().family(), 10, QFont::Bold);
defFont = cfg->readFontEntry("Font", &defFont);
setFont(defFont);
m_prefs_action = KStdAction::preferences(this, SLOT(configureDialog()), parent->actionCollection());
m_quit_action = KStdAction::quit(kapp, SLOT(quit()), parent->actionCollection());
updateLayout();
}
示例5: readConfig
void KopeteRichTextEditPart::readConfig()
{
// Don't update config untill we read whole config first
m_configWriteLock = true;
KConfig *config = KGlobal::config();
config->setGroup("RichTextEditor");
QColor tmpColor = KGlobalSettings::textColor();
setFgColor( config->readColorEntry("FgColor", &tmpColor ) );
tmpColor = KGlobalSettings::baseColor();
setBgColor( config->readColorEntry("BgColor", &tmpColor ) );
QFont tmpFont = KopetePrefs::prefs()->fontFace();
setFont( config->readFontEntry("Font", &tmpFont ) );
int tmp = KGlobalSettings::generalFont().pixelSize();
setFontSize( config->readNumEntry( "FontSize", tmp ) );
action_bold->setChecked( config->readBoolEntry( "FontBold" ) );
action_italic->setChecked( config->readBoolEntry( "FontItalic" ) );
action_underline->setChecked( config->readBoolEntry( "FontUnderline" ) );
switch( config->readNumEntry( "EditAlignment", AlignLeft ) )
{
case AlignLeft:
action_align_left->activate();
break;
case AlignCenter:
action_align_center->activate();
break;
case AlignRight:
action_align_right->activate();
break;
case AlignJustify:
action_align_justify->activate();
break;
}
m_configWriteLock = false;
}
示例6: fm
ChangeLogDialog::ChangeLogDialog(KConfig& cfg, QWidget *parent, const char *name)
: KDialogBase(parent, name, true, i18n("Edit ChangeLog"),
Ok | Cancel, Ok, true)
, partConfig(cfg)
{
edit = new KTextEdit(this);
cfg.setGroup("LookAndFeel");
edit->setFont(cfg.readFontEntry("ChangeLogFont"));
edit->setFocus();
edit->setWordWrap(QTextEdit::NoWrap);
edit->setTextFormat(QTextEdit::PlainText);
edit->setCheckSpellingEnabled(true);
QFontMetrics const fm(edit->fontMetrics());
edit->setMinimumSize(fm.width('0') * 80,
fm.lineSpacing() * 20);
setMainWidget(edit);
QSize size = configDialogSize(partConfig, "ChangeLogDialog");
resize(size);
}
示例7: aboutData
//.........这里部分代码省略.........
{
sessionconfig->setGroup(QString("%1").arg(n));
if(!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
int session_count = sessionconfig->readNumEntry("numSes");
int counter = 0;
wname = sessionconfig->readEntry("class", wname).latin1();
sPgm = sessionconfig->readEntry("Pgm0", shell);
sessionconfig->readListEntry("Args0", eargs);
sTitle = sessionconfig->readEntry("Title0", title);
sTerm = sessionconfig->readEntry("Term0");
sIcon = sessionconfig->readEntry("Icon0", "konsole");
sCwd = sessionconfig->readPathEntry("Cwd0");
workDir = sessionconfig->readPathEntry("workdir");
n_tabbar = QMIN(sessionconfig->readUnsignedNumEntry("tabbar", Konsole::TabBottom), 2);
Konsole *m = new Konsole(wname, histon, menubaron, tabbaron, frameon, scrollbaron, 0 /*type*/, true, n_tabbar, workDir);
m->newSession(sPgm, eargs, sTerm, sIcon, sTitle, sCwd);
m->enableFullScripting(full_script);
m->enableFixedSize(fixed_size);
m->restore(n);
sessionconfig->setGroup(QString("%1").arg(n));
if(!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
m->makeGUI();
m->setEncoding(sessionconfig->readNumEntry("Encoding0"));
m->setSchema(sessionconfig->readEntry("Schema0"));
// Use konsolerc default as tmpFont instead?
QFont tmpFont = KGlobalSettings::fixedFont();
m->initSessionFont(sessionconfig->readFontEntry("SessionFont0", &tmpFont));
m->initSessionKeyTab(sessionconfig->readEntry("KeyTab0"));
m->initMonitorActivity(sessionconfig->readBoolEntry("MonitorActivity0", false));
m->initMonitorSilence(sessionconfig->readBoolEntry("MonitorSilence0", false));
m->initMasterMode(sessionconfig->readBoolEntry("MasterMode0", false));
m->initTabColor(sessionconfig->readColorEntry("TabColor0"));
// -1 will be changed to the default history in konsolerc
m->initHistory(sessionconfig->readNumEntry("History0", -1), sessionconfig->readBoolEntry("HistoryEnabled0", true));
counter++;
// show() before 2nd+ sessions are created allows --profile to
// initialize the TE size correctly.
m->show();
while(counter < session_count)
{
key = QString("Title%1").arg(counter);
sTitle = sessionconfig->readEntry(key, title);
key = QString("Args%1").arg(counter);
sessionconfig->readListEntry(key, eargs);
key = QString("Pgm%1").arg(counter);
// if the -e option is passed on the command line, this overrides the program specified
// in the profile file
if(args->isSet("e"))
sPgm = (shell ? QFile::decodeName(shell) : QString::null);
else
sPgm = sessionconfig->readEntry(key, shell);
key = QString("Term%1").arg(counter);
sTerm = sessionconfig->readEntry(key);
key = QString("Icon%1").arg(counter);
示例8: read
/******************************************************************************
* Read preference values from the config file.
*/
void Preferences::read()
{
initialise();
KConfig *config = KGlobal::config();
config->setGroup(GENERAL_SECTION);
QStringList cols = config->readListEntry(MESSAGE_COLOURS);
if(!cols.count())
mMessageColours = default_messageColours;
else
{
mMessageColours.clear();
for(QStringList::Iterator it = cols.begin(); it != cols.end(); ++it)
{
QColor c((*it));
if(c.isValid())
mMessageColours.insert(c);
}
}
mDefaultBgColour = config->readColorEntry(MESSAGE_BG_COLOUR, &default_defaultBgColour);
mMessageFont = config->readFontEntry(MESSAGE_FONT, &mDefault_messageFont);
mRunInSystemTray = config->readBoolEntry(RUN_IN_SYSTEM_TRAY, default_runInSystemTray);
mDisableAlarmsIfStopped = config->readBoolEntry(DISABLE_IF_STOPPED, default_disableAlarmsIfStopped);
mAutostartTrayIcon = config->readBoolEntry(AUTOSTART_TRAY, default_autostartTrayIcon);
mModalMessages = config->readBoolEntry(MODAL_MESSAGES, default_modalMessages);
mMessageButtonDelay = config->readNumEntry(MESSAGE_BUTTON_DELAY, default_messageButtonDelay);
if(mMessageButtonDelay > 10)
mMessageButtonDelay = 10; // prevent windows being unusable for a long time
if(mMessageButtonDelay < -1)
mMessageButtonDelay = -1;
mTooltipAlarmCount = static_cast<int>(config->readUnsignedNumEntry(TOOLTIP_ALARM_COUNT, default_tooltipAlarmCount));
if(mTooltipAlarmCount < 1)
mTooltipAlarmCount = 1;
mShowTooltipAlarmTime = config->readBoolEntry(TOOLTIP_ALARM_TIME, default_showTooltipAlarmTime);
mShowTooltipTimeToAlarm = config->readBoolEntry(TOOLTIP_TIME_TO_ALARM, default_showTooltipTimeToAlarm);
mTooltipTimeToPrefix = config->readEntry(TOOLTIP_TIME_TO_PREFIX, default_tooltipTimeToPrefix);
mDaemonTrayCheckInterval = static_cast<int>(config->readUnsignedNumEntry(DAEMON_TRAY_INTERVAL, default_daemonTrayCheckInterval));
if(mDaemonTrayCheckInterval < 1)
mDaemonTrayCheckInterval = 1;
QCString client = config->readEntry(EMAIL_CLIENT,
defaultEmailClient).local8Bit(); // don't use readPathEntry() here (values are hard-coded)
mEmailClient = (client == "sendmail" ? SENDMAIL : KMAIL);
mEmailCopyToKMail = config->readBoolEntry(EMAIL_COPY_TO_KMAIL, default_emailCopyToKMail);
QString from = config->readEntry(EMAIL_FROM, emailFrom(default_emailFrom(), false, false));
mEmailFrom = emailFrom(from);
QString bccFrom = config->readEntry(EMAIL_BCC_ADDRESS, emailFrom(default_emailBccFrom, false, true));
mEmailBccFrom = emailFrom(bccFrom);
if(mEmailFrom == MAIL_FROM_CONTROL_CENTRE || mEmailBccFrom == MAIL_FROM_CONTROL_CENTRE)
mEmailAddress = mEmailBccAddress = KAMail::controlCentreAddress();
if(mEmailFrom == MAIL_FROM_ADDR)
mEmailAddress = from;
if(mEmailBccFrom == MAIL_FROM_ADDR)
mEmailBccAddress = bccFrom;
mCmdXTermCommand = translateXTermPath(config, config->readEntry(CMD_XTERM_COMMAND), false);
QDateTime defStartOfDay(QDate(1900, 1, 1), default_startOfDay);
mStartOfDay = config->readDateTimeEntry(START_OF_DAY, &defStartOfDay).time();
mOldStartOfDay.setHMS(0, 0, 0);
int sod = config->readNumEntry(START_OF_DAY_CHECK, 0);
if(sod)
mOldStartOfDay = mOldStartOfDay.addMSecs(sod ^ SODxor);
mDisabledColour = config->readColorEntry(DISABLED_COLOUR, &default_disabledColour);
mExpiredColour = config->readColorEntry(EXPIRED_COLOUR, &default_expiredColour);
mExpiredKeepDays = config->readNumEntry(EXPIRED_KEEP_DAYS, default_expiredKeepDays);
config->setGroup(DEFAULTS_SECTION);
mDefaultLateCancel = static_cast<int>(config->readUnsignedNumEntry(DEF_LATE_CANCEL, default_defaultLateCancel));
mDefaultAutoClose = config->readBoolEntry(DEF_AUTO_CLOSE, default_defaultAutoClose);
mDefaultConfirmAck = config->readBoolEntry(DEF_CONFIRM_ACK, default_defaultConfirmAck);
mDefaultCopyToKOrganizer = config->readBoolEntry(DEF_COPY_TO_KORG, default_defaultCopyToKOrganizer);
int soundType = config->readNumEntry(DEF_SOUND_TYPE, default_defaultSoundType);
mDefaultSoundType = (soundType < 0 || soundType > SoundPicker::SPEAK)
? default_defaultSoundType : (SoundPicker::Type)soundType;
mDefaultSoundVolume = static_cast<float>(config->readDoubleNumEntry(DEF_SOUND_VOLUME, default_defaultSoundVolume));
#ifdef WITHOUT_ARTS
mDefaultSoundRepeat = false;
#else
mDefaultSoundRepeat = config->readBoolEntry(DEF_SOUND_REPEAT, default_defaultSoundRepeat);
#endif
mDefaultSoundFile = config->readPathEntry(DEF_SOUND_FILE);
mDefaultCmdScript = config->readBoolEntry(DEF_CMD_SCRIPT, default_defaultCmdScript);
int logType = config->readNumEntry(DEF_CMD_LOG_TYPE, default_defaultCmdLogType);
mDefaultCmdLogType = (logType < EditAlarmDlg::DISCARD_OUTPUT || logType > EditAlarmDlg::EXEC_IN_TERMINAL)
? default_defaultCmdLogType : (EditAlarmDlg::CmdLogType)logType;
mDefaultCmdLogFile = config->readPathEntry(DEF_LOG_FILE);
mDefaultEmailBcc = config->readBoolEntry(DEF_EMAIL_BCC, default_defaultEmailBcc);
int recurPeriod = config->readNumEntry(DEF_RECUR_PERIOD, default_defaultRecurPeriod);
mDefaultRecurPeriod = (recurPeriod < RecurrenceEdit::SUBDAILY || recurPeriod > RecurrenceEdit::ANNUAL)
? default_defaultRecurPeriod : (RecurrenceEdit::RepeatType)recurPeriod;
QCString feb29 = config->readEntry(FEB29_RECUR_TYPE, defaultFeb29RecurType).local8Bit();
mDefaultFeb29Type = (feb29 == "Mar1") ? KARecurrence::FEB29_MAR1 : (feb29 == "Feb28") ? KARecurrence::FEB29_FEB28 : KARecurrence::FEB29_FEB29;
QString remindUnits = config->readEntry(DEF_REMIND_UNITS);
mDefaultReminderUnits = (remindUnits == QString::fromLatin1("Minutes")) ? TimePeriod::MINUTES
: (remindUnits == QString::fromLatin1("HoursMinutes")) ? TimePeriod::HOURS_MINUTES
: (remindUnits == QString::fromLatin1("Days")) ? TimePeriod::DAYS
: (remindUnits == QString::fromLatin1("Weeks")) ? TimePeriod::WEEKS : default_defaultReminderUnits;
mDefaultPreAction = config->readEntry(DEF_PRE_ACTION, default_defaultPreAction);
mDefaultPostAction = config->readEntry(DEF_POST_ACTION, default_defaultPostAction);
//.........这里部分代码省略.........
示例9: updateConfig
void EventWidget::updateConfig()
{
KConfig *config;
config = kapp->getConfig();
config->setGroup("Fonts");
setFont(config->readFontEntry("Schedule Font"));
config->setGroup( "Colors" );
selectedHandle = config->readColorEntry( "AptSelected" );
inactiveHandle = config->readColorEntry( "AptUnselected" );
activeHandle = config->readColorEntry( "AptActive" );
QColorGroup normalGroup(
black, //kapp->windowColor, // foreground, used for the edge
//kapp->windowColor,
config->readColorEntry( "AptBackground" ),
// background, used for non text area in textbox
green, //config->readColorEntry( "AptUnselected" ),// light
red, // dark
red, // mid
config->readColorEntry( "AptText" ), // text
//kapp->windowColor
config->readColorEntry( "AptBackground" )
// base used for background behind text
);
// for displaying currently happening event ...
QColorGroup activeGroup(
selectedHandle, // for the edge
config->readColorEntry( "AptBackground" ),
green, // light
red, // dark
red, // mid
config->readColorEntry( "AptText" ), // text
config->readColorEntry( "AptBackground" )
);
QColorGroup disabledGroup(
black, //kapp->windowColor, // foreground, used for the edge
//kapp->windowColor,
config->readColorEntry( "AptBackground" ).dark(120),
// background, used for non text area in textbox
green, //config->readColorEntry( "AptUnselected" ),// light
red, // dark
red, // mid
config->readColorEntry( "AptText" ), // text
//kapp->windowColor
config->readColorEntry( "AptBackground" ).dark(120)
// base used for background behind text
);
QPalette myPalette;
myPalette.setNormal( normalGroup );
myPalette.setActive( activeGroup );
myPalette.setDisabled(disabledGroup);
setPalette(myPalette);
// we don't want the hilite border for other widgets except
// the main widget, so set the active color group to normalGroup.
myPalette.setActive(normalGroup);
textBox->setPalette( myPalette );
iconBox->setPalette( myPalette );
setSelected( widgetSelected ); // to set handle color
}