本文整理汇总了C++中KisConfig::setCustomColorSelectorColorSpace方法的典型用法代码示例。如果您正苦于以下问题:C++ KisConfig::setCustomColorSelectorColorSpace方法的具体用法?C++ KisConfig::setCustomColorSelectorColorSpace怎么用?C++ KisConfig::setCustomColorSelectorColorSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisConfig
的用法示例。
在下文中一共展示了KisConfig::setCustomColorSelectorColorSpace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: savePreferences
void KisColorSelectorSettings::savePreferences() const
{
// write cfg
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
KConfigGroup hsxcfg = KSharedConfig::openConfig()->group("hsxColorSlider");
KConfigGroup hotkeycfg = KSharedConfig::openConfig()->group("colorhotkeys");
// advanced color selector
cfg.writeEntry("onDockerResize", ui->dockerResizeOptionsComboBox->currentIndex());
cfg.writeEntry("zoomSelectorOptions", ui->zoomSelectorOptionComboBox->currentIndex() );
cfg.writeEntry("zoomSize", ui->popupSize->value());
bool useCustomColorSpace = ui->useDifferentColorSpaceCheckbox->isChecked();
const KoColorSpace* colorSpace = useCustomColorSpace ? ui->colorSpace->currentColorSpace() : 0;
KisConfig kisconfig;
kisconfig.setCustomColorSelectorColorSpace(colorSpace);
//color patches
cfg.writeEntry("lastUsedColorsShow", ui->lastUsedColorsShow->isChecked());
cfg.writeEntry("lastUsedColorsAlignment", ui->lastUsedColorsAlignVertical->isChecked());
cfg.writeEntry("lastUsedColorsScrolling", ui->lastUsedColorsAllowScrolling->isChecked());
cfg.writeEntry("lastUsedColorsNumCols", ui->lastUsedColorsNumCols->value());
cfg.writeEntry("lastUsedColorsNumRows", ui->lastUsedColorsNumRows->value());
cfg.writeEntry("lastUsedColorsCount", ui->lastUsedColorsPatchCount->value());
cfg.writeEntry("lastUsedColorsWidth", ui->lastUsedColorsWidth->value());
cfg.writeEntry("lastUsedColorsHeight", ui->lastUsedColorsHeight->value());
cfg.writeEntry("commonColorsShow", ui->commonColorsShow->isChecked());
cfg.writeEntry("commonColorsAlignment", ui->commonColorsAlignVertical->isChecked());
cfg.writeEntry("commonColorsScrolling", ui->commonColorsAllowScrolling->isChecked());
cfg.writeEntry("commonColorsNumCols", ui->commonColorsNumCols->value());
cfg.writeEntry("commonColorsNumRows", ui->commonColorsNumRows->value());
cfg.writeEntry("commonColorsCount", ui->commonColorsPatchCount->value());
cfg.writeEntry("commonColorsWidth", ui->commonColorsWidth->value());
cfg.writeEntry("commonColorsHeight", ui->commonColorsHeight->value());
cfg.writeEntry("commonColorsAutoUpdate", ui->commonColorsAutoUpdate->isChecked());
//shade selector
int shadeSelectorTypeIndex = ui->ACSShadeSelectorTypeComboBox->currentIndex();
if(shadeSelectorTypeIndex == 0) {
cfg.writeEntry("shadeSelectorType", "MyPaint");
} else if (shadeSelectorTypeIndex == 1) {
cfg.writeEntry("shadeSelectorType", "Minimal");
} else {
cfg.writeEntry("shadeSelectorType", "Hidden");
}
cfg.writeEntry("shadeSelectorUpdateOnRightClick", ui->shadeSelectorUpdateOnRightClick->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnForeground", ui->shadeSelectorUpdateOnForeground->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnLeftClick", ui->shadeSelectorUpdateOnLeftClick->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnBackground", ui->shadeSelectorUpdateOnBackground->isChecked());
cfg.writeEntry("hidePopupOnClickCheck", ui->hidePopupOnClickCheck->isChecked());
//mypaint model
int shadeMyPaintComboBoxIndex = ui->ACSshadeSelectorMyPaintColorModelComboBox->currentIndex();
if (shadeMyPaintComboBoxIndex == 0 ) {
cfg.writeEntry("shadeMyPaintType", "HSV");
} else if (shadeMyPaintComboBoxIndex == 1 ) {
cfg.writeEntry("shadeMyPaintType", "HSL");
} else if (shadeMyPaintComboBoxIndex == 2 ) {
cfg.writeEntry("shadeMyPaintType", "HSI");
} else { // HSY
cfg.writeEntry("shadeMyPaintType", "HSY");
}
cfg.writeEntry("minimalShadeSelectorAsGradient", ui->minimalShadeSelectorAsGradient->isChecked());
cfg.writeEntry("minimalShadeSelectorPatchCount", ui->minimalShadeSelectorPatchesPerLine->value());
cfg.writeEntry("minimalShadeSelectorLineConfig", ui->minimalShadeSelectorLineSettings->toString());
cfg.writeEntry("minimalShadeSelectorLineHeight", ui->minimalShadeSelectorLineHeight->value());
//color selector
KisColorSelectorComboBox* cstw = dynamic_cast<KisColorSelectorComboBox*>(ui->colorSelectorConfiguration);
cfg.writeEntry("colorSelectorConfiguration", cstw->configuration().toString());
cfg.writeEntry("hsxSettingType", ui->colorSelectorTypeComboBox->currentIndex());
//luma//
cfg.writeEntry("lumaR", ui->l_lumaR->value());
cfg.writeEntry("lumaG", ui->l_lumaG->value());
cfg.writeEntry("lumaB", ui->l_lumaB->value());
cfg.writeEntry("gamma", ui->SP_Gamma->value());
//slider//
hsxcfg.writeEntry("hsvH", ui->csl_hsvH->isChecked());
hsxcfg.writeEntry("hsvS", ui->csl_hsvS->isChecked());
hsxcfg.writeEntry("hsvV", ui->csl_hsvV->isChecked());
hsxcfg.writeEntry("hslH", ui->csl_hslH->isChecked());
hsxcfg.writeEntry("hslS", ui->csl_hslS->isChecked());
hsxcfg.writeEntry("hslL", ui->csl_hslL->isChecked());
//.........这里部分代码省略.........
示例2: savePreferences
void KisColorSelectorSettings::savePreferences() const
{
//write cfg
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
//general
cfg.writeEntry("shadeSelectorHideable", ui->shadeSelectorHideable->isChecked());
cfg.writeEntry("allowHorizontalLayout", ui->allowHorizontalLayout->isChecked());
cfg.writeEntry("popupOnMouseOver", ui->popupOnMouseOver->isChecked());
cfg.writeEntry("popupOnMouseClick", ui->popupOnMouseClick->isChecked());
cfg.writeEntry("zoomSize", ui->popupSize->value());
bool useCustomColorSpace = ui->useCustomColorSpace->isChecked();
const KoColorSpace* colorSpace = useCustomColorSpace ?
ui->colorSpace->currentColorSpace() : 0;
KisConfig kisconfig;
kisconfig.setCustomColorSelectorColorSpace(colorSpace);
//color patches
cfg.writeEntry("lastUsedColorsShow", ui->lastUsedColorsShow->isChecked());
cfg.writeEntry("lastUsedColorsAlignment", ui->lastUsedColorsAlignVertical->isChecked());
cfg.writeEntry("lastUsedColorsScrolling", ui->lastUsedColorsAllowScrolling->isChecked());
cfg.writeEntry("lastUsedColorsNumCols", ui->lastUsedColorsNumCols->value());
cfg.writeEntry("lastUsedColorsNumRows", ui->lastUsedColorsNumRows->value());
cfg.writeEntry("lastUsedColorsCount", ui->lastUsedColorsPatchCount->value());
cfg.writeEntry("lastUsedColorsWidth", ui->lastUsedColorsWidth->value());
cfg.writeEntry("lastUsedColorsHeight", ui->lastUsedColorsHeight->value());
cfg.writeEntry("commonColorsShow", ui->commonColorsShow->isChecked());
cfg.writeEntry("commonColorsAlignment", ui->commonColorsAlignVertical->isChecked());
cfg.writeEntry("commonColorsScrolling", ui->commonColorsAllowScrolling->isChecked());
cfg.writeEntry("commonColorsNumCols", ui->commonColorsNumCols->value());
cfg.writeEntry("commonColorsNumRows", ui->commonColorsNumRows->value());
cfg.writeEntry("commonColorsCount", ui->commonColorsPatchCount->value());
cfg.writeEntry("commonColorsWidth", ui->commonColorsWidth->value());
cfg.writeEntry("commonColorsHeight", ui->commonColorsHeight->value());
cfg.writeEntry("commonColorsAutoUpdate", ui->commonColorsAutoUpdate->isChecked());
//shade selector
QString shadeSelectorType("MyPaint");
if(ui->shadeSelectorTypeMinimal->isChecked())
shadeSelectorType="Minimal";
if(ui->shadeSelectorTypeHidden->isChecked())
shadeSelectorType="Hidden";
cfg.writeEntry("shadeSelectorType", shadeSelectorType);
cfg.writeEntry("shadeSelectorUpdateOnRightClick", ui->shadeSelectorUpdateOnRightClick->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnForeground", ui->shadeSelectorUpdateOnForeground->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnLeftClick", ui->shadeSelectorUpdateOnLeftClick->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnBackground", ui->shadeSelectorUpdateOnBackground->isChecked());
cfg.writeEntry("minimalShadeSelectorAsGradient", ui->minimalShadeSelectorAsGradient->isChecked());
cfg.writeEntry("minimalShadeSelectorPatchCount", ui->minimalShadeSelectorPatchesPerLine->value());
cfg.writeEntry("minimalShadeSelectorLineConfig", ui->minimalShadeSelectorLineSettings->toString());
cfg.writeEntry("minimalShadeSelectorLineHeight", ui->minimalShadeSelectorLineHeight->value());
//color selector
KisColorSelectorComboBox* cstw = dynamic_cast<KisColorSelectorComboBox*>(ui->colorSelectorConfiguration);
cfg.writeEntry("colorSelectorConfiguration", cstw->configuration().toString());
emit settingsChanged();
}