本文整理汇总了C++中domError函数的典型用法代码示例。如果您正苦于以下问题:C++ domError函数的具体用法?C++ domError怎么用?C++ domError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了domError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
*/
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例9: domError
void Text::read(const QDomElement& de)
{
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!readProperties(e))
domError(e);
}
}
示例10: domError
void Breath::read(QDomElement e)
{
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (!Element::readProperties(e))
domError(e);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}