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


C++ KisConfig::setCustomColorSelectorColorSpace方法代码示例

本文整理汇总了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());
//.........这里部分代码省略.........
开发者ID:KDE,项目名称:krita,代码行数:101,代码来源:kis_color_selector_settings.cpp

示例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();
}
开发者ID:,项目名称:,代码行数:64,代码来源:


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