本文整理汇总了C++中TextStyle::align方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStyle::align方法的具体用法?C++ TextStyle::align怎么用?C++ TextStyle::align使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStyle
的用法示例。
在下文中一共展示了TextStyle::align方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTextStyle
void TextProp::setTextStyle(const TextStyle& s)
{
fontBold->setChecked(s.bold());
fontItalic->setChecked(s.italic());
fontUnderline->setChecked(s.underline());
fontSize->setValue(s.size());
color->setColor(s.foregroundColor());
systemFlag->setChecked(s.systemFlag());
int a = s.align();
if (a & ALIGN_HCENTER)
alignHCenter->setChecked(true);
else if (a & ALIGN_RIGHT)
alignRight->setChecked(true);
else
alignLeft->setChecked(true);
if (a & ALIGN_VCENTER)
alignVCenter->setChecked(true);
else if (a & ALIGN_BOTTOM)
alignBottom->setChecked(true);
else if (a & ALIGN_BASELINE)
alignBaseline->setChecked(true);
else
alignTop->setChecked(true);
QString str;
if (s.offsetType() == OFFSET_ABS) {
xOffset->setValue(s.offset().x() * INCH);
yOffset->setValue(s.offset().y() * INCH);
mmUnit->setChecked(true);
curUnit = 0;
}
else if (s.offsetType() == OFFSET_SPATIUM) {
xOffset->setValue(s.offset().x());
yOffset->setValue(s.offset().y());
spatiumUnit->setChecked(true);
curUnit = 1;
}
rxOffset->setValue(s.reloff().x());
ryOffset->setValue(s.reloff().y());
QFont f(s.family());
f.setPixelSize(lrint(s.size()));
f.setItalic(s.italic());
f.setUnderline(s.underline());
f.setBold(s.bold());
fontSelect->setCurrentFont(f);
sizeIsSpatiumDependent->setChecked(s.sizeIsSpatiumDependent());
frameColor->setColor(s.frameColor());
bgColor->setColor(s.backgroundColor());
frameWidth->setValue(s.frameWidth());
frame->setChecked(s.hasFrame());
paddingWidth->setValue(s.paddingWidth());
frameRound->setValue(s.frameRound());
circleButton->setChecked(s.circle());
boxButton->setChecked(!s.circle());
}
示例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");