本文整理汇总了C++中TextStyle::setAlign方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStyle::setAlign方法的具体用法?C++ TextStyle::setAlign怎么用?C++ TextStyle::setAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStyle
的用法示例。
在下文中一共展示了TextStyle::setAlign方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: textStyle
TextStyle TextProp::textStyle() const
{
TextStyle s;
if (curUnit == 0)
s.setOffsetType(OFFSET_ABS);
else if (curUnit == 1)
s.setOffsetType(OFFSET_SPATIUM);
s.setBold(fontBold->isChecked());
s.setItalic(fontItalic->isChecked());
s.setUnderline(fontUnderline->isChecked());
s.setSize(fontSize->value());
QFont f = fontSelect->currentFont();
s.setFamily(f.family());
s.setXoff(xOffset->value() / ((s.offsetType() == OFFSET_ABS) ? INCH : 1.0));
s.setYoff(yOffset->value() / ((s.offsetType() == OFFSET_ABS) ? INCH : 1.0));
s.setRxoff(rxOffset->value());
s.setRyoff(ryOffset->value());
s.setFrameColor(frameColor->color());
s.setBackgroundColor(bgColor->color());
s.setFrameWidth(frameWidth->value());
s.setPaddingWidth(paddingWidth->value());
s.setCircle(circleButton->isChecked());
s.setFrameRound(frameRound->value());
s.setHasFrame(frame->isChecked());
s.setSystemFlag(systemFlag->isChecked());
s.setForegroundColor(color->color());
s.setSizeIsSpatiumDependent(sizeIsSpatiumDependent->isChecked());
Align a = 0;
if (alignHCenter->isChecked())
a |= ALIGN_HCENTER;
else if (alignRight->isChecked())
a |= ALIGN_RIGHT;
if (alignVCenter->isChecked())
a |= ALIGN_VCENTER;
else if (alignBottom->isChecked())
a |= ALIGN_BOTTOM;
else if (alignBaseline->isChecked())
a |= ALIGN_BASELINE;
s.setAlign(a);
return s;
}
示例2: if
//.........这里部分代码省略.........
else if (tag == "showInvisible")
_showInvisible = e.readInt();
else if (tag == "showFrames")
_showFrames = e.readInt();
else if (tag == "showMargins")
_showPageborders = e.readInt();
else if (tag == "Style") {
qreal sp = _style.spatium();
_style.load(e);
// adjust this now so chords render properly on read
// other style adjustments can wait until reading is finished
if (style(StyleIdx::useGermanNoteNames).toBool())
style()->set(StyleIdx::useStandardNoteNames, false);
if (_layoutMode == LayoutMode::FLOAT) {
// style should not change spatium in
// float mode
_style.setSpatium(sp);
}
}
else if (tag == "TextStyle") {
TextStyle s;
s.read(e);
qreal spMM = _style.spatium() / MScore::DPMM;
if (s.frameWidthMM() != 0.0)
s.setFrameWidth(Spatium(s.frameWidthMM() / spMM));
if (s.paddingWidthMM() != 0.0)
s.setPaddingWidth(Spatium(s.paddingWidthMM() / spMM));
\
// convert 1.2 text styles
s.setName(convertOldTextStyleNames(s.name()));
if (s.name() == "Lyrics Odd Lines" || s.name() == "Lyrics Even Lines")
s.setAlign((s.align() & ~ Align(AlignmentFlags::VMASK)) | AlignmentFlags::BASELINE);
_style.setTextStyle(s);
}
else if (tag == "page-layout") {
if (_layoutMode != LayoutMode::FLOAT && _layoutMode != LayoutMode::SYSTEM) {
PageFormat pf;
pf.copy(*pageFormat());
pf.read(e, this);
setPageFormat(pf);
}
else
e.skipCurrentElement();
}
else if (tag == "copyright" || tag == "rights") {
Text* text = new Text(this);
text->read(e);
text->layout();
setMetaTag("copyright", text->plainText());
delete text;
}
else if (tag == "movement-number")
setMetaTag("movementNumber", e.readElementText());
else if (tag == "movement-title")
setMetaTag("movementTitle", e.readElementText());
else if (tag == "work-number")
setMetaTag("workNumber", e.readElementText());
else if (tag == "work-title")
setMetaTag("workTitle", e.readElementText());
else if (tag == "source")
setMetaTag("source", e.readElementText());
else if (tag == "metaTag") {
QString name = e.attribute("name");