本文整理汇总了C++中ParagraphStyle::numName方法的典型用法代码示例。如果您正苦于以下问题:C++ ParagraphStyle::numName方法的具体用法?C++ ParagraphStyle::numName怎么用?C++ ParagraphStyle::numName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParagraphStyle
的用法示例。
在下文中一共展示了ParagraphStyle::numName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStyle
void PropertyWidget_ParEffect::updateStyle(const ParagraphStyle& newPStyle)
{
if (peCombo->currentIndex() && !newPStyle.hasBullet() && !newPStyle.hasDropCap() && !newPStyle.hasNum())
{
enableParEffect(false);
return;
}
disconnectSignals ();
bool enablePE = true;
if (newPStyle.hasDropCap())
{
peCombo->setCurrentIndex(1);
enableDropCap(true);
}
else if (newPStyle.hasBullet())
{
peCombo->setCurrentIndex(2);
enableBullet(true);
}
else if (newPStyle.hasNum())
{
peCombo->setCurrentIndex(3);
enableNum(true);
}
else
enablePE = false;
QString numName = numComboBox->currentText();
int nFormat = 0;
dropCapLines->setValue(newPStyle.dropCapLines());
bulletStrEdit->setEditText(newPStyle.bulletStr());
numName = newPStyle.numName();
if (numName == "")
numName = "<local block>";
numComboBox->setCurrentIndex(numComboBox->findText(numName));
NumStruct * numS = m_doc->numerations.value(numName);
if (numS)
numLevelSpin->setMaximum(numS->m_counters.count()+1);
else
numLevelSpin->setMaximum(3);
numLevelSpin->setValue(newPStyle.numLevel() +1);
numPrefix->setText(newPStyle.numPrefix());
numSuffix->setText(newPStyle.numSuffix());
numStart->setValue(newPStyle.numStart());
nFormat = newPStyle.numFormat();
numFormatCombo->setCurrentIndex(nFormat);
peOffset->setValue(newPStyle.parEffectOffset() * m_unitRatio);
peIndent->setChecked(newPStyle.parEffectIndent());
showCharStyle(newPStyle.peCharStyleName());
enableParEffect(enablePE);
connectSignals ();
}
示例2: handleParEffectUse
void PropertyWidget_ParEffect::handleParEffectUse()
{
if (!m_doc || !m_item)
return;
ParagraphStyle newStyle;
enableParEffect(peCombo->currentIndex() != 0);
if (peCombo->currentIndex() == 1)
{
enableDropCap(true);
newStyle.setDropCapLines(dropCapLines->value());
newStyle.setHasDropCap(true);
newStyle.setHasBullet(false);
newStyle.setHasNum(false);
}
else if (peCombo->currentIndex() == 2)
{
enableBullet(true);
newStyle.setHasBullet(true);
QString bStr = bulletStrEdit->currentText();
if (bStr.isEmpty())
bStr = QChar(0x2022);
newStyle.setBulletStr(bStr);
newStyle.setHasNum(false);
newStyle.setHasDropCap(false);
}
else if (peCombo->currentIndex() == 3)
{
enableNum(true);
newStyle.setHasDropCap(false);
newStyle.setHasBullet(false);
newStyle.setHasNum(true);
newStyle.setNumName(numComboBox->currentText());
newStyle.setNumFormat(numFormatCombo->currentIndex());
newStyle.setNumLevel(numLevelSpin->value() -1);
newStyle.setNumStart(numStart->value());
newStyle.setNumPrefix(numPrefix->text());
newStyle.setNumSuffix(numSuffix->text());
if (newStyle.numName() == "<local block>")
{
newStyle.setNumOther(true);
newStyle.setNumHigher(true);
}
}
else
{
newStyle.setHasDropCap(false);
newStyle.setHasBullet(false);
newStyle.setHasNum(false);
}
newStyle.setParEffectOffset(peOffset->value() / m_unitRatio);
newStyle.setParEffectIndent(peIndent->isChecked());
handleChanges(m_item, newStyle);
}