本文整理汇总了C++中domError函数的典型用法代码示例。如果您正苦于以下问题:C++ domError函数的具体用法?C++ domError怎么用?C++ domError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了domError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setSubtype
void Articulation::read(QDomElement e)
{
setSubtype(0); // default
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
QString val(e.text());
if (tag == "idx") // obsolete
setSubtype(val.toInt());
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
Direction dir = AUTO;
if (val == "up")
dir = UP;
else if (val == "down")
dir = DOWN;
else if (val == "auto")
dir = AUTO;
else
domError(e);
// printf("setDirection %s %d\n", qPrintable(val), int(dir));
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
/* if (subtype() == Articulation_Schleifer) {
printf("Schleifer %f %f\n", readPos().x(), readPos().y());
setReadPos(QPointF());
}
*/
}
开发者ID:SSMN,项目名称:MuseScore,代码行数:34,代码来源:articulation.cpp
示例2: setSubtype
void Articulation::read(const QDomElement& de)
{
setSubtype(Articulation_Fermata); // default // backward compatibility (no type = ufermata in 1.2)
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype")
setSubtype(val);
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
MScore::Direction dir = MScore::AUTO;
if (val == "up")
dir = MScore::UP;
else if (val == "down")
dir = MScore::DOWN;
else if (val == "auto")
dir = MScore::AUTO;
else
domError(e);
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:aiena,项目名称:MuseScore,代码行数:28,代码来源:articulation.cpp
示例3: tag
void SyntiState::read(QDomElement e)
{
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
QString name = e.attribute("name");
if (tag == "f") {
double val = e.attribute("val").toDouble();
append(SyntiParameter(name, val));
}
else if (tag == "s")
append(SyntiParameter(name, e.attribute("val")));
else if (tag == "Synth") {
// obsolete
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
QString tag(ee.tagName());
if (tag == "f") {
double val = ee.attribute("val").toDouble();
append(SyntiParameter(name, val));
}
else if (tag == "s")
append(SyntiParameter(name, ee.attribute("val")));
else
domError(ee);
}
}
else
domError(e);
}
}
开发者ID:Mistobaan,项目名称:MuseScore,代码行数:29,代码来源:sparm.cpp
示例4: setSubtype
void Articulation::read(const QDomElement& de)
{
setSubtype(Articulation_Staccato); // default
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype")
setSubtype(val);
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
Direction dir = AUTO;
if (val == "up")
dir = UP;
else if (val == "down")
dir = DOWN;
else if (val == "auto")
dir = AUTO;
else
domError(e);
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:Archer90,项目名称:MuseScore,代码行数:28,代码来源:articulation.cpp
示例5: QPainterPath
void ChordLine::read(const QDomElement& de)
{
path = QPainterPath();
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
if (tag == "Path") {
path = QPainterPath();
QPointF curveTo;
QPointF p1;
int state = 0;
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
QString tag(ee.tagName());
if (tag == "Element") {
int type = ee.attribute("type").toInt();
qreal x = ee.attribute("x").toDouble();
qreal y = ee.attribute("y").toDouble();
switch(QPainterPath::ElementType(type)) {
case QPainterPath::MoveToElement:
path.moveTo(x, y);
break;
case QPainterPath::LineToElement:
path.lineTo(x, y);
break;
case QPainterPath::CurveToElement:
curveTo.rx() = x;
curveTo.ry() = y;
state = 1;
break;
case QPainterPath::CurveToDataElement:
if (state == 1) {
p1.rx() = x;
p1.ry() = y;
state = 2;
}
else if (state == 2) {
path.cubicTo(curveTo, p1, QPointF(x, y));
state = 0;
}
break;
}
}
else
domError(ee);
}
modified = true;
setSubtype(ChordLineType(0));
}
else if (tag == "subtype")
setSubtype(ChordLineType(e.text().toInt()));
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:alexkonradi,项目名称:MuseScore,代码行数:53,代码来源:chordline.cpp
示例6: f
void Shortcut::load()
{
QFile f(dataPath + "/shortcuts.xml");
if (!f.exists())
f.setFileName(":/data/shortcuts.xml");
if (!f.open(QIODevice::ReadOnly)) {
printf("cannot open shortcuts\n");
return;
}
QDomDocument doc;
int line, column;
QString err;
if (!doc.setContent(&f, false, &err, &line, &column)) {
printf("error reading shortcuts.xml at line %d column %d: %s\n",
line, column, qPrintable(err));
return;
}
f.close();
QString key;
for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "Shortcuts") {
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
if (ee.tagName() == "SC") {
Shortcut* sc = 0;
for (QDomElement eee = ee.firstChildElement(); !eee.isNull(); eee = eee.nextSiblingElement()) {
const QString& tag(eee.tagName());
const QString& val(eee.text());
if (tag == "key") {
sc = getShortcut(val.toAscii().data());
if (!sc) {
printf("cannot find shortcut <%s>\n", qPrintable(val));
break;
}
sc->clear();
}
else if (tag == "std")
sc->_standardKey = QKeySequence::StandardKey(val.toInt());
else if (tag == "seq")
sc->_keys.append(QKeySequence::fromString(val, QKeySequence::PortableText));
else
domError(eee);
}
}
else
domError(ee);
}
}
else
domError(e);
}
dirty = false;
}
开发者ID:klushund,项目名称:MuseScore,代码行数:53,代码来源:shortcut.cpp
示例7: tag
int SigEvent::read(const QDomElement& de, int fileDivision)
{
int tick = de.attribute("tick", "0").toInt();
tick = tick * MScore::division / fileDivision;
int numerator = 1;
int denominator = 1;
int denominator2 = -1;
int numerator2 = -1;
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
int i = e.text().toInt();
if (tag == "nom")
numerator = i;
else if (tag == "denom")
denominator = i;
else if (tag == "nom2")
numerator2 = i;
else if (tag == "denom2")
denominator2 = i;
else
domError(e);
}
if ((numerator2 == -1) || (denominator2 == -1)) {
numerator2 = numerator;
denominator2 = denominator;
}
_timesig = Fraction(numerator, denominator);
_nominal = Fraction(numerator2, denominator2);
return tick;
}
开发者ID:Mistobaan,项目名称:MuseScore,代码行数:32,代码来源:sig.cpp
示例8: tag
void StaffTypeTablature::read(const QDomElement& de)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "durations")
setGenDurations(val.toInt() != 0);
else if (tag == "durationFontName")
setDurationFontName(e.text());
else if (tag == "durationFontSize")
setDurationFontSize(val.toDouble());
else if (tag == "durationFontY")
setDurationFontUserY(val.toDouble());
else if (tag == "fretFontName")
setFretFontName(e.text());
else if (tag == "fretFontSize")
setFretFontSize(val.toDouble());
else if (tag == "fretFontY")
setFretFontUserY(val.toDouble());
else if (tag == "linesThrough")
setLinesThrough(val.toInt() != 0);
else if (tag == "onLines")
setOnLines(val.toInt() != 0);
else if (tag == "timesig")
setGenTimesig(val.toInt() != 0);
else if (tag == "upsideDown")
setUpsideDown(val.toInt() != 0);
else if (tag == "useNumbers")
setUseNumbers(val.toInt() != 0);
else
if(!StaffType::readProperties(e))
domError(e);
}
}
开发者ID:Archer90,项目名称:MuseScore,代码行数:35,代码来源:stafftype.cpp
示例9: domError
void Text::read(const QDomElement& de)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!readProperties(e))
domError(e);
}
}
开发者ID:aeliot,项目名称:MuseScore,代码行数:7,代码来源:text.cpp
示例10: domError
void Breath::read(QDomElement e)
{
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:SSMN,项目名称:MuseScore,代码行数:7,代码来源:breath.cpp
示例11: tag
void Marker::read(const QDomElement& de)
{
MarkerType mt = MARKER_SEGNO;
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
if (tag == "label") {
setLabel(e.text());
mt = markerType(e.text());
}
else if (!Text::readProperties(e))
domError(e);
}
switch (mt) {
case MARKER_SEGNO:
case MARKER_VARSEGNO:
case MARKER_CODA:
case MARKER_VARCODA:
case MARKER_CODETTA:
setTextStyleType(TEXT_STYLE_REPEAT_LEFT);
break;
case MARKER_FINE:
case MARKER_TOCODA:
setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
break;
case MARKER_USER:
setTextStyleType(TEXT_STYLE_REPEAT);
break;
}
setMarkerType(mt);
}
开发者ID:aeliot,项目名称:MuseScore,代码行数:32,代码来源:repeat.cpp
示例12: qDebug
void Drumset::load(const QDomElement& de)
{
int pitch = de.attribute("pitch", "-1").toInt();
if (pitch < 0 || pitch > 127) {
qDebug("load drumset: invalid pitch %d\n", pitch);
return;
}
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
QString val(e.text());
bool isNum;
int i = val.toInt(&isNum);
if (tag == "head")
_drum[pitch].notehead = Note::NoteHeadGroup(i);
else if (tag == "line")
_drum[pitch].line = i;
else if (tag == "voice")
_drum[pitch].voice = i;
else if (tag == "name")
_drum[pitch].name = val;
else if (tag == "stem")
_drum[pitch].stemDirection = MScore::Direction(i);
else if (tag == "shortcut")
_drum[pitch].shortcut = isNum ? i : toupper(val[0].toLatin1());
else
domError(e);
}
}
开发者ID:alexkonradi,项目名称:MuseScore,代码行数:29,代码来源:drumset.cpp
示例13: tag
void Image::read(const QDomElement& de)
{
if (score()->mscVersion() <= 123)
_sizeIsSpatium = false;
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
if (tag == "autoScale")
setProperty(P_AUTOSCALE, ::getProperty(P_AUTOSCALE, e));
else if (tag == "size")
setProperty(P_SIZE, ::getProperty(P_SIZE, e));
else if (tag == "lockAspectRatio")
setProperty(P_LOCK_ASPECT_RATIO, ::getProperty(P_LOCK_ASPECT_RATIO, e));
else if (tag == "sizeIsSpatium")
setProperty(P_SIZE_IS_SPATIUM, ::getProperty(P_SIZE_IS_SPATIUM, e));
else if (tag == "path")
_storePath = e.text();
else if(tag == "linkPath")
_linkPath = e.text();
else if (!Element::readProperties(e))
domError(e);
}
// once all paths are read, load img or retrieve it from store
// loading from file is tried first to update the stored image, if necessary
if(_linkPath.isEmpty() || !load(_linkPath)) {
// if could not load img from _linkPath, retrieve from store
_storeItem = imageStore.getImage(_storePath);
if (_storeItem)
_storeItem->reference(this);
// if not in store, try to load from _storePath for backward compatibility
else
load(_storePath);
}
}
开发者ID:nutmegkat,项目名称:MuseScore,代码行数:35,代码来源:image.cpp
示例14: loadDefaultShortcuts
static QList<Shortcut1*> loadDefaultShortcuts()
{
QList<Shortcut1*> list;
QFile f(":/data/shortcuts.xml");
if (!f.open(QIODevice::ReadOnly)) {
printf("cannot open shortcuts\n");
return list;
}
QDomDocument doc;
int line, column;
QString err;
if (!doc.setContent(&f, false, &err, &line, &column)) {
printf("error reading shortcuts.xml at line %d column %d: %s\n",
line, column, qPrintable(err));
return list;
}
f.close();
QString key;
for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "Shortcuts") {
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
if (ee.tagName() == "SC") {
Shortcut1* sc = new Shortcut1;
sc->key = 0;
for (QDomElement eee = ee.firstChildElement(); !eee.isNull(); eee = eee.nextSiblingElement()) {
const QString& tag(eee.tagName());
const QString& val(eee.text());
if (tag == "key")
sc->key = strdup(val.toAscii().data());
else if (tag == "std")
sc->standardKey = QKeySequence::StandardKey(val.toInt());
else if (tag == "seq")
sc->keys.append(QKeySequence::fromString(val, QKeySequence::PortableText));
else
domError(eee);
}
}
else
domError(ee);
}
}
else
domError(e);
}
return list;
}
开发者ID:klushund,项目名称:MuseScore,代码行数:47,代码来源:shortcut.cpp
示例15: extractRootfile
static bool extractRootfile(QFile* qf, QByteArray& data)
{
MQZipReader f(qf->fileName());
data = f.fileData("META-INF/container.xml");
QDomDocument container;
int line, column;
QString err;
if (!container.setContent(data, false, &err, &line, &column)) {
MScore::lastError = QObject::tr("Error reading container.xml at line %1 column %2: %3\n").arg(line).arg(column).arg(err);
return false;
}
// extract first rootfile
QString rootfile = "";
for (QDomElement e = container.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "container") {
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
if (ee.tagName() == "rootfiles") {
for (QDomElement eee = ee.firstChildElement(); !eee.isNull(); eee = eee.nextSiblingElement()) {
if (eee.tagName() == "rootfile") {
if (rootfile == "")
rootfile = eee.attribute(QString("full-path"));
}
else
domError(eee);
}
}
else
domError(ee);
}
}
else
domError(e);
}
if (rootfile == "") {
qDebug("can't find rootfile in: %s", qPrintable(qf->fileName()));
MScore::lastError = QObject::tr("Can't find rootfile\n%1").arg(qf->fileName());
return false;
}
// read the rootfile
data = f.fileData(rootfile);
return true;
}
开发者ID:FryderykChopin,项目名称:MuseScore,代码行数:46,代码来源:importxml.cpp
示例16: if
void NoteDot::read(const QDomElement& de)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "name") // obsolete
;
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:Archer90,项目名称:MuseScore,代码行数:9,代码来源:notedot.cpp
示例17: domError
void Rest::read(const QDomElement& de, QList<Tuplet*>* tuplets, QList<Spanner*>* spanner)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!ChordRest::readProperties(e, tuplets, spanner))
domError(e);
}
QPointF off(userOff());
setUserOffset(off.x(), off.y());
}
开发者ID:fyzix,项目名称:MuseScore,代码行数:9,代码来源:rest.cpp
示例18: staff
void BarLine::read(const QDomElement& de)
{
// if bar line belongs to a staff, span values default to staff values
if(staff()) {
_span = staff()->barLineSpan();
_spanFrom = staff()->barLineFrom();
_spanTo = staff()->barLineTo();
}
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype") {
bool ok;
int i = val.toInt(&ok);
if (!ok)
setSubtype(val);
else {
BarLineType ct = NORMAL_BAR;
switch (i) {
default:
case 0: ct = NORMAL_BAR; break;
case 1: ct = DOUBLE_BAR; break;
case 2: ct = START_REPEAT; break;
case 3: ct = END_REPEAT; break;
case 4: ct = BROKEN_BAR; break;
case 5: ct = END_BAR; break;
case 6: ct = END_START_REPEAT; break;
case 7: ct = DOTTED_BAR; break;
}
setSubtype(ct);
}
if(parent() && parent()->type() == SEGMENT) {
Measure* m = static_cast<Segment*>(parent())->measure();
if(subtype() != m->endBarLineType())
setCustomSubtype(true);
}
}
else if (tag == "customSubtype")
setCustomSubtype(val.toInt() != 0);
else if (tag == "span") {
_span = val.toInt();
_spanFrom = e.attribute("from", QString::number(_spanFrom)).toInt();
_spanTo = e.attribute("to", QString::number(_spanTo)).toInt();
// WARNING: following statements assume staff and staff bar line spans are correctly set
if(staff() && (_span != staff()->barLineSpan()
|| _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))
_customSpan = true;
}
else if (tag == "Articulation") {
Articulation* a = new Articulation(score());
a->read(e);
add(a);
}
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:aeliot,项目名称:MuseScore,代码行数:57,代码来源:barline.cpp
示例19: setSubtype
void Tremolo::read(const QDomElement& de)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "subtype")
setSubtype(e.text());
else if (!Element::readProperties(e))
domError(e);
}
}
开发者ID:aeliot,项目名称:MuseScore,代码行数:9,代码来源:tremolo.cpp
示例20: domError
void Rest::read(QDomElement e, const QList<Tuplet*>& tuplets, QList<Slur*>* slurs)
{
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!ChordRest::readProperties(e, tuplets, slurs))
domError(e);
}
QPointF off(userOff());
setUserOffset(off.x(), off.y());
}
开发者ID:gthomas,项目名称:MuseScore,代码行数:9,代码来源:rest.cpp
注:本文中的domError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论