本文整理汇总了C++中KConfig::readColorEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readColorEntry方法的具体用法?C++ KConfig::readColorEntry怎么用?C++ KConfig::readColorEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readColorEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: initColors
void KFinder::initColors(){
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "KFM HTML Defaults" );
bgColor = config->readColorEntry( "BgColor", &white );
textColor = config->readColorEntry( "LinkColor", &black );
if(finderWin)
finderWin->setBackgroundColor( bgColor );
}
示例3: 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() );
}
示例4: readSettings
// read settings from config file
void KBlankSetup::readSettings()
{
KConfig *config = KGlobal::config();
config->setGroup("Settings");
color = config->readColorEntry("Color", &black);
}
示例5: readParameters
void MyFracWindow::readParameters()
{
KConfig* config = kapp->config();
config->setGroup("Parameters");
_sliderIterations->setValue(config->readNumEntry("Iterations", 2));
_sliderQuality->setValue(config->readNumEntry("Quality", 5));
_sliderScale->setValue(config->readNumEntry("Scale", 15));
_sliderOffset->setValue(config->readNumEntry("Offset", 0));
_sliderScroll->setValue(config->readNumEntry("Scroll", 25));
_sliderHeight->setValue(config->readNumEntry("Height", 20));
_comboGrid->setCurrentItem(config->readNumEntry("Grid", 1));
setGridSize(_comboGrid->currentItem());
QColor black(0, 0, 0);
_colorButton->setColor(config->readColorEntry("Background", &black));
QStringList list = config->readListEntry("Gradient");
if (list.size() == 4) {
Gradient gradient(list[0] == "hsv");
gradient.getSpline(0).fromString(list[1]);
gradient.getSpline(1).fromString(list[2]);
gradient.getSpline(2).fromString(list[3]);
setGradient(gradient);
} else
setGradient(_presets.getDefault());
QSize defSize(800, 600);
_imageSize = config->readSizeEntry("ImageSize", &defSize);
_imageMime = config->readEntry("ImageMime", "image/png");
_imagePath = config->readEntry("ImagePath");
}
示例6: reload
void KFLConfigPage::reload()
{
// read in from config file
KConfig *config = kapp->config();
config->setGroup( "Filelist" );
cbEnableShading->setChecked( config->readBoolEntry("Shading Enabled", &m_filelist->m_enableBgShading ) );
kcbViewShade->setColor( config->readColorEntry("View Shade", &m_filelist->m_viewShade ) );
kcbEditShade->setColor( config->readColorEntry("Edit Shade", &m_filelist->m_editShade ) );
cmbSort->setCurrentItem( m_filelist->sortType() );
m_changed = false;
}
示例7: readConfigColor
void ColorSchema::readConfigColor(KConfig& c,
const QString& name,
ColorEntry& e)
{
KConfigGroupSaver(&c,name);
c.setGroup(name);
e.color = c.readColorEntry("Color");
e.transparent = c.readBoolEntry("Transparent",false);
e.bold = c.readBoolEntry("Bold",false);
}
示例8: readSettings
void QtCalculator::readSettings()
{
QColor tmpC(189, 255, 180);
QColor blackC(0,0,0);
KConfig *config = KGlobal::config();
config->setGroup("CalcPlugin");
kcalcdefaults.forecolor = config->readColorEntry("ForeColor", &blackC);
kcalcdefaults.backcolor = config->readColorEntry("BackColor", &tmpC);
#ifdef HAVE_LONG_DOUBLE
kcalcdefaults.precision = config->readNumEntry("precision", (int)14);
#else
kcalcdefaults.precision = config->readNumEntry("precision", (int)10);
#endif
kcalcdefaults.fixedprecision = config->readNumEntry("fixedprecision", (int)2);
kcalcdefaults.fixed = config->readBoolEntry("fixed", false);
kcalcdefaults.style = config->readNumEntry("style", (int)0);
kcalcdefaults.beep = config->readBoolEntry("beep", true);
}
示例9: qGray
QColor
PrettyPopupMenu::calcPixmapColor()
{
KConfig *config = KGlobal::config();
config->setGroup("WM");
QColor color = QApplication::palette().active().highlight();
// QColor activeTitle = QApplication::palette().active().background();
// QColor inactiveTitle = QApplication::palette().inactive().background();
QColor activeTitle = config->readColorEntry("activeBackground", &color);
QColor inactiveTitle = config->readColorEntry("inactiveBackground", &color);
// figure out which color is most suitable for recoloring to
int h1, s1, v1, h2, s2, v2, h3, s3, v3;
activeTitle.hsv(&h1, &s1, &v1);
inactiveTitle.hsv(&h2, &s2, &v2);
QApplication::palette().active().background().hsv(&h3, &s3, &v3);
if ( (kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < kAbs(h2-h3)+kAbs(s2-s3)+kAbs(v2-v3)) &&
((kAbs(h1-h3)+kAbs(s1-s3)+kAbs(v1-v3) < 32) || (s1 < 32)) && (s2 > s1))
color = inactiveTitle;
else
color = activeTitle;
// limit max/min brightness
int r, g, b;
color.rgb(&r, &g, &b);
int gray = qGray(r, g, b);
if (gray > 180) {
r = (r - (gray - 180) < 0 ? 0 : r - (gray - 180));
g = (g - (gray - 180) < 0 ? 0 : g - (gray - 180));
b = (b - (gray - 180) < 0 ? 0 : b - (gray - 180));
} else if (gray < 76) {
r = (r + (76 - gray) > 255 ? 255 : r + (76 - gray));
g = (g + (76 - gray) > 255 ? 255 : g + (76 - gray));
b = (b + (76 - gray) > 255 ? 255 : b + (76 - gray));
}
color.setRgb(r, g, b);
return color;
}
示例10: 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;
}
示例11: readColorConfig
void FavoriteFolderView::readColorConfig()
{
FolderTreeBase::readColorConfig();
KConfig *conf = KMKernel::config();
// Custom/System color support
KConfigGroupSaver saver(conf, "Reader");
QColor c = KGlobalSettings::alternateBackgroundColor();
if(!conf->readBoolEntry("defaultColors", true))
mPaintInfo.colBack = conf->readColorEntry("AltBackgroundColor", &c);
else
mPaintInfo.colBack = c;
QPalette newPal = palette();
newPal.setColor(QColorGroup::Base, mPaintInfo.colBack);
setPalette(newPal);
}
示例12: load
void CSSConfig::load( bool useDefaults )
{
KConfig *c = new KConfig("kcmcssrc", false, false);
c->setReadDefaults( useDefaults );
c->setGroup("Stylesheet");
QString u = c->readEntry("Use", "default");
configDialog->useDefault->setChecked(u == "default");
configDialog->useUser->setChecked(u == "user");
configDialog->useAccess->setChecked(u == "access");
configDialog->urlRequester->setURL(c->readEntry("SheetName"));
c->setGroup("Font");
customDialog->basefontsize->setEditText(QString::number(c->readNumEntry("BaseSize", 12)));
customDialog->dontScale->setChecked(c->readBoolEntry("DontScale", false));
QString fname = c->readEntry("Family", "Arial");
for (int i=0; i < customDialog->fontFamily->count(); ++i)
if (customDialog->fontFamily->text(i) == fname)
{
customDialog->fontFamily->setCurrentItem(i);
break;
}
customDialog->sameFamily->setChecked(c->readBoolEntry("SameFamily", false));
c->setGroup("Colors");
QString m = c->readEntry("Mode", "black-on-white");
customDialog->blackOnWhite->setChecked(m == "black-on-white");
customDialog->whiteOnBlack->setChecked(m == "white-on-black");
customDialog->customColor->setChecked(m == "custom");
customDialog->backgroundColor->setColor(c->readColorEntry("BackColor", &Qt::white));
customDialog->foregroundColor->setColor(c->readColorEntry("ForeColor", &Qt::black));
customDialog->sameColor->setChecked(c->readBoolEntry("SameColor", false));
// Images
c->setGroup("Images");
customDialog->hideImages->setChecked(c->readBoolEntry("Hide", false));
customDialog->hideBackground->setChecked(c->readBoolEntry("HideBackground", true));
delete c;
emit changed( useDefaults );
}
示例13: _readSettings
void ThemeStandard::_readSettings()
{
if ( !mTheme )
return;
KConfig *cfg = mTheme->themeConfig();
if ( !cfg )
return;
//if ( !cfg->hasGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ) )
// return;
cfg->setGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) );
QString sbpos = cfg->readEntry( "Statusbar Position", "Bottom" ).upper();
mSbAtTop = ( sbpos == "TOP" );
mSbVisible = cfg->readBoolEntry( "Statusbar Visible", true);
mSbPbVisible = cfg->readBoolEntry( "Progress Visible", true);
mSbFontName = cfg->readEntry( "Statusbar Font", "Sans Serif" );
mSbFontSz = cfg->readNumEntry( "Statusbar Font Size", 16 );
mSbFontBold = cfg->readBoolEntry( "Statusbar Font Bold", true );
mSbFontItalic = cfg->readBoolEntry( "Statusbar Font Italic", false );
mSbFont = QFont( mSbFontName, mSbFontSz, ( mSbFontBold? QFont::Bold : QFont::Normal ) );
if( mSbFontItalic )
mSbFont.setItalic( true );
mSbFg = cfg->readColorEntry( "Statusbar Foreground", &Qt::white );
mSbBg = cfg->readColorEntry( "Statusbar Background", &Qt::black );
mSbIcon = cfg->readEntry( "Statusbar Icon", "run" );
mIconsVisible = cfg->readBoolEntry( "Icons Visible", true);
mIconsJumping = cfg->readBoolEntry( "Icons Jumping", true);
mIconPos = (WndIcon::Position)cfg->readNumEntry( "Icon Position", 0 );
mSplashScreen = cfg->readEntry( "Splash Screen", "(Default)");
// cfg->readBoolEntry( "Allow Configuration", true );
}
示例14: loadConfig
void KMixApplet::loadConfig()
{
kdDebug(67100) << "KMixApplet::loadConfig()" << endl;
KConfig *cfg = this->config();
cfg->setGroup(0);
_mixerId = cfg->readEntry( "Mixer", "undef" );
_mixerName = cfg->readEntry( "MixerName", QString::null );
_customColors = cfg->readBoolEntry( "ColorCustom", false );
_colors.high = cfg->readColorEntry("ColorHigh", &highColor);
_colors.low = cfg->readColorEntry("ColorLow", &lowColor);
_colors.back = cfg->readColorEntry("ColorBack", &backColor);
_colors.mutedHigh = cfg->readColorEntry("ColorMutedHigh", &mutedHighColor);
_colors.mutedLow = cfg->readColorEntry("ColorMutedLow", &mutedLowColor);
_colors.mutedBack = cfg->readColorEntry("ColorMutedBack", &mutedBackColor);
loadConfig( cfg, "Widget");
}
示例15: KMainWindow
MainWindow::MainWindow ( const char * name ) : KMainWindow ( 0L, name )
{
// QPopupMenu *filemenu;
// KMenuBar *menu;
setCaption("Flickr Wallpaper Grabber");
setIcon(
QPixmap( QString( "%1/flickr.png" ).arg( PWD ) )
);
// filemenu = new QPopupMenu;
// filemenu->insertItem( i18n( "&Quit" ), kapp, SLOT( quit() ) );
// menu = menuBar();
// menu->insertItem( i18n( "&File" ), filemenu);
// global color scheme info
KConfig *cfg = KGlobal::config();
cfg->setGroup( "General" );
alternateBackground = cfg->readColorEntry( "alternateBackground" );
// desktop info
dwidth = KApplication::desktop()->width();
dheight = KApplication::desktop()->height();
dratio = (float)dwidth / (float)dheight;
desktops = KWin::numberOfDesktops();
// layout
vbox = new QVBox(this);
sv = new KScrollView(vbox);
central = new QWidget(sv->viewport());
grid = new QGridLayout(central, 10, 1, 0, 5);
vbox->setSpacing(5);
sv->addChild(central);
sv->setResizePolicy(QScrollView::AutoOneFit);
count = 0;
page = 0;
// setup photo rows
PhotoRow *row;
for (int i = 0; i < 10; i++) {
row = new PhotoRow( central, desktops );
row->hide();
row->setSpacing(5);
if (i % 2 == 1)
row->setPaletteBackgroundColor( alternateBackground );
grid->addWidget(row, i, 0);
rows.append(row);
}
// button setup
QHBox *box = new QHBox( vbox );
backButton = new KPushButton( "Back", box );
goButton = new KPushButton( "Go!", box );
nextButton = new KPushButton( "Next", box );
connect(backButton, SIGNAL(clicked()), this, SLOT(back()));
connect(goButton, SIGNAL(clicked()), this, SLOT(go()));
connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
backButton->setEnabled(false);
setCentralWidget(vbox);
grabPhotos();
}