本文整理汇总了C++中StyleSet::create方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleSet::create方法的具体用法?C++ StyleSet::create怎么用?C++ StyleSet::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleSet
的用法示例。
在下文中一共展示了StyleSet::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateParagraphStyle
void gtAction::updateParagraphStyle(int pstyleIndex, gtParagraphStyle* pstyle)
{
gtFont* font = pstyle->getFont();
ParagraphStyle vg;
setParaStyleAttributes(pstyle, vg);
setCharStyleAttributes(font, vg.charStyle());
// Maybe set those attributes when target is the frame
/*vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setTracking(0);
vg.charStyle().setUnderlineOffset(textFrame->doc()->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(textFrame->doc()->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);*/
StyleSet<ParagraphStyle> tmp;
tmp.create(vg);
textFrame->doc()->redefineStyles(tmp, false);
if (vg.name() != textFrame->doc()->paragraphStyles()[pstyleIndex].name())
{
QMap<QString, QString> map;
map[textFrame->doc()->paragraphStyles()[pstyleIndex].name()] = vg.name();
textFrame->doc()->replaceStyles(map);
}
}
示例2: createParagraphStyle
void gtAction::createParagraphStyle(gtParagraphStyle* pstyle)
{
ScribusDoc* currDoc=textFrame->doc();
for (int i = 0; i < currDoc->paragraphStyles().count(); ++i)
{
if (currDoc->paragraphStyles()[i].name() == pstyle->getName())
return;
}
gtFont* font = pstyle->getFont();
ParagraphStyle vg;
setParaStyleAttributes(pstyle, vg);
setCharStyleAttributes(font, vg.charStyle());
// Maybe set those attributes when target is the frame
/*vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setTracking(0);
vg.charStyle().setUnderlineOffset(textFrame->doc()->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(textFrame->doc()->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);*/
StyleSet<ParagraphStyle> tmp;
tmp.create(vg);
textFrame->doc()->redefineStyles(tmp, false);
m_ScMW->propertiesPalette->textPal->updateParagraphStyles();
}