本文整理汇总了C++中ParagraphStyle::applyStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ ParagraphStyle::applyStyle方法的具体用法?C++ ParagraphStyle::applyStyle怎么用?C++ ParagraphStyle::applyStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParagraphStyle
的用法示例。
在下文中一共展示了ParagraphStyle::applyStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateUniqueCopyName
PageItem_NoteFrame::PageItem_NoteFrame(NotesStyle *nStyle, ScribusDoc *doc, double x, double y, double w, double h, double w2, QString fill, QString outline)
: PageItem_TextFrame(doc, x, y, w, h, w2, fill, outline)
{
m_nstyle = nStyle;
m_masterFrame = NULL;
itemText.clear();
AnName = generateUniqueCopyName(nStyle->isEndNotes() ? tr("Endnote frame ") + m_nstyle->name() : tr("Footnote frame ") + m_nstyle->name(), false);
AutoName = false; //endnotes frame will saved with name
setUName(AnName);
//set default style for note frame
ParagraphStyle newStyle;
if (nStyle->notesParStyle().isEmpty() || (nStyle->notesParStyle() == tr("No Style")))
{
if (nStyle->isEndNotes())
//set default doc style
newStyle.setParent(m_Doc->paragraphStyles()[0].name());
else
{
newStyle.setParent(m_masterFrame->itemText.defaultStyle().parent());
newStyle.applyStyle(m_masterFrame->currentStyle());
}
}
else
newStyle.setParent(nStyle->notesParStyle());
itemText.blockSignals(true);
itemText.setDefaultStyle(newStyle);
itemText.blockSignals(false);
textFlowModeVal = TextFlowUsesFrameShape;
setColumns(1);
if (m_nstyle->isAutoNotesHeight())
m_SizeVLocked = true;
else
m_SizeVLocked = false;
if (m_nstyle->isAutoNotesWidth())
m_SizeHLocked = true;
else
m_SizeHLocked = false;
if (m_nstyle->isAutoNotesHeight() && m_nstyle->isAutoNotesWidth())
m_SizeLocked = true;
else
m_SizeLocked = false;
deleteIt = false;
}
示例2: setNS
void PageItem_NoteFrame::setNS(NotesStyle *nStyle, PageItem_TextFrame* master)
{
m_nstyle = nStyle;
if (master != NULL)
m_masterFrame = master;
itemText.clear();
AnName = generateUniqueCopyName(m_nstyle->isEndNotes() ? "Endnote frame " + m_nstyle->name() : "Footnote frame " + m_nstyle->name(), false);
setUName(AnName);
//set default style for note frame
ParagraphStyle newStyle;
if (nStyle->notesParStyle().isEmpty() || (nStyle->notesParStyle() == tr("No Style")))
{
if (nStyle->isEndNotes() || (m_masterFrame == NULL))
{
//set default doc style
newStyle.setParent(m_Doc->paragraphStyles()[0].name());
}
else if (master != NULL)
{
newStyle.setParent(m_masterFrame->itemText.defaultStyle().parent());
newStyle.applyStyle(m_masterFrame->currentStyle());
}
}
else
newStyle.setParent(nStyle->notesParStyle());
itemText.blockSignals(true);
itemText.setDefaultStyle(newStyle);
itemText.blockSignals(false);
if (m_nstyle->isAutoNotesHeight())
m_SizeVLocked = true;
else
m_SizeVLocked = false;
if (m_nstyle->isAutoNotesWidth())
m_SizeHLocked = true;
else
m_SizeHLocked = false;
if (m_nstyle->isAutoNotesHeight() && m_nstyle->isAutoNotesWidth())
m_SizeLocked = true;
else
m_SizeLocked = false;
}