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


C++ KoListLevelProperties::labelType方法代码示例

本文整理汇总了C++中KoListLevelProperties::labelType方法的典型用法代码示例。如果您正苦于以下问题:C++ KoListLevelProperties::labelType方法的具体用法?C++ KoListLevelProperties::labelType怎么用?C++ KoListLevelProperties::labelType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KoListLevelProperties的用法示例。


在下文中一共展示了KoListLevelProperties::labelType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setDisplay

void ParagraphBulletsNumbers::setDisplay(KoParagraphStyle *style, int level, bool directFormattingMode)
{
    KoListStyle *listStyle = style->listStyle();
    widget.listPropertiesPane->setEnabled(listStyle != 0);
    widget.customCharacter->setText("-");
    if (listStyle == 0) {
        widget.listTypes->setCurrentRow(0);
        return;
    }

    KoListLevelProperties llp = listStyle->levelProperties(level);
    m_previousLevel = llp.level();
    widget.prefix->setText(llp.listItemPrefix());
    widget.suffix->setText(llp.listItemSuffix());
    widget.letterSynchronization->setChecked(llp.letterSynchronization());
    KoListStyle::LabelType labelType = llp.labelType();
    foreach(int row, m_mapping.keys()) {
        if (m_mapping[row] == labelType) {
            widget.listTypes->setCurrentRow(row);
            break;
        }
    }
    int align;
    if (llp.alignment() == (Qt::AlignLeft | Qt::AlignAbsolute))
        align = 1;
    else if (llp.alignment() == (Qt::AlignRight | Qt::AlignAbsolute))
        align = 2;
    else if (llp.alignment() == Qt::AlignCenter)
        align = 3;
    else
        align = 0;

    widget.alignment->setCurrentIndex(align);
    widget.depth->setValue(llp.level());
    widget.levels->setValue(llp.displayLevel());
    widget.startValue->setValue(llp.startValue());
    if (labelType == KoListStyle::BulletCharLabelType)
        widget.customCharacter->setText(llp.bulletCharacter());

    if (labelType == KoListStyle::ImageLabelType) {
        m_data = llp.bulletImage();
        widget.imageHeight->setValue(llp.height());
        widget.imageWidth->setValue(llp.width());
    } else {
        m_data = 0;
        widget.imageHeight->setValue(0);
        widget.imageWidth->setValue(0);
    }

    if(llp.alignmentMode()==false) {//for list-level-position-and-space-mode=label-width-and-position disable the following options
        widget.label_8->setEnabled(false);
        widget.label_9->setEnabled(false);
        widget.label_10->setEnabled(false);
        widget.label_11->setEnabled(false);

        widget.labelFollowedBy->setEnabled(false);
        widget.doubleSpinBox->setEnabled(false);
        widget.doubleSpinBox_2->setEnabled(false);
        widget.doubleSpinBox_3->setEnabled(false);
    } else {
        m_alignmentMode=true;
        switch(llp.labelFollowedBy()) {
        case KoListStyle::ListTab:
            widget.doubleSpinBox->setEnabled(true);
            widget.labelFollowedBy->setCurrentIndex(0);
            widget.doubleSpinBox->setValue(KoUnit::toCentimeter(llp.tabStopPosition()));
            break;
        case KoListStyle::Space:
            widget.doubleSpinBox->setEnabled(false);
            widget.labelFollowedBy->setCurrentIndex(1);
            break;
        case KoListStyle::Nothing:
            widget.doubleSpinBox->setEnabled(false);
            widget.labelFollowedBy->setCurrentIndex(2);
            break;
        default:
            Q_ASSERT(false);
        }

        widget.doubleSpinBox_2->setValue(KoUnit::toCentimeter(llp.margin()));
        widget.doubleSpinBox_3->setValue(KoUnit::toCentimeter(llp.margin())+KoUnit::toCentimeter(llp.textIndent()));
    }

    // *** features not in GUI;
    // character style
    // relative bullet size (percent)
    // minimum label width
    recalcPreview();
}
开发者ID:KDE,项目名称:calligra,代码行数:89,代码来源:ParagraphBulletsNumbers.cpp


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