本文整理汇总了C++中Symbol::adjustReadPos方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::adjustReadPos方法的具体用法?C++ Symbol::adjustReadPos怎么用?C++ Symbol::adjustReadPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol::adjustReadPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
void Symbol::read(XmlReader& e)
{
QPointF pos;
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "name") {
QString val(e.readElementText());
SymId symId = Sym::name2id(val);
if (val != "noSym") {
if (symId == SymId::noSym) {
// if symbol name not found, fall back to user names
// TODO : does it make sense? user names are probably localized
symId = Sym::userName2id(val);
// if not found, look into old names
if (symId == SymId::noSym)
symId = Sym::oldName2id(val);
if (symId == SymId::noSym) {
qDebug("unknown symbol <%s>, falling back to no symbol", qPrintable(val));
// set a default symbol, or layout() will crash
symId = SymId::noSym;
}
}
}
setSym(symId);
}
else if (tag == "font")
_scoreFont = ScoreFont::fontFactory(e.readElementText());
else if (tag == "Symbol") {
Symbol* s = new Symbol(score());
s->read(e);
s->adjustReadPos();
add(s);
}
else if (tag == "Image") {
if (MScore::noImages)
e.skipCurrentElement();
else {
Image* image = new Image(score());
image->read(e);
add(image);
}
}
else if (tag == "small" || tag == "subtype") // obsolete
e.skipCurrentElement();
else if (!BSymbol::readProperties(e))
e.unknown();
}
setPos(pos);
}
示例2: read
void Symbol::read(XmlReader& e)
{
QPointF pos;
SymId s = noSym;
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "name") {
QString val(e.readElementText());
if (val == "acc dot") // compatibility hack
val = "accordion.accDot";
else if (val == "acc old ee")
val = "accordion.accOldEE";
s = Sym::name2id(val);
if (s == noSym) {
// if symbol name not found, fall back to mnames
s = Sym::userName2id(val);
if (s == noSym) {
qDebug("unknown symbol <%s> (%d symbols), falling back to default symbol",
qPrintable(val), symbols[0].size());
// set a default symbol, or layout() will crash
s = s1miHeadSym;
}
}
}
else if (tag == "Symbol") {
Symbol* s = new Symbol(score());
s->read(e);
s->adjustReadPos();
add(s);
}
else if (tag == "Image") {
Image* image = new Image(score());
QString path;
image->read(e);
add(image);
}
else if (tag == "small" || tag == "subtype")
;
else if (!BSymbol::readProperties(e))
e.unknown();
}
if (s == noSym)
qDebug("unknown symbol");
setPos(pos);
setSym(s);
}