本文整理汇总了C++中musecore::Xml::parse1方法的典型用法代码示例。如果您正苦于以下问题:C++ Xml::parse1方法的具体用法?C++ Xml::parse1怎么用?C++ Xml::parse1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类musecore::Xml
的用法示例。
在下文中一共展示了Xml::parse1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readConfiguration
void Arranger::readConfiguration(MusECore::Xml& xml)
{
for (;;) {
MusECore::Xml::Token token(xml.parse());
const QString& tag(xml.s1());
switch (token) {
case MusECore::Xml::Error:
case MusECore::Xml::End:
return;
case MusECore::Xml::TagStart:
if (tag == "tlist_header")
header_state = QByteArray::fromHex(xml.parse1().toLatin1());
else if (tag == "custom_columns")
readCustomColumns(xml);
else
xml.unknown("Arranger");
break;
case MusECore::Xml::TagEnd:
if (tag == "arranger")
return;
default:
break;
}
}
}
示例2: readOneCustomColumn
Arranger::custom_col_t Arranger::readOneCustomColumn(MusECore::Xml& xml)
{
custom_col_t temp(0, "-");
for (;;) {
MusECore::Xml::Token token(xml.parse());
const QString& tag(xml.s1());
switch (token) {
case MusECore::Xml::Error:
case MusECore::Xml::End:
return temp;
case MusECore::Xml::TagStart:
if (tag == "name")
temp.name=xml.parse1();
else if (tag == "ctrl")
temp.ctrl=xml.parseInt();
else if (tag == "affected_pos")
temp.affected_pos=(custom_col_t::affected_pos_t)xml.parseInt();
else
xml.unknown("Arranger::readOneCustomColumn");
break;
case MusECore::Xml::TagEnd:
if (tag == "column")
return temp;
default:
break;
}
}
return temp;
}
示例3: readConfiguration
void TopWin::readConfiguration(ToplevelType t, MusECore::Xml& xml)
{
if (initInited==false)
initConfiguration();
for (;;)
{
MusECore::Xml::Token token = xml.parse();
if (token == MusECore::Xml::Error || token == MusECore::Xml::End)
break;
const QString& tag = xml.s1();
switch (token)
{
case MusECore::Xml::TagStart:
if (tag == "width")
_widthInit[t] = xml.parseInt();
else if (tag == "height")
_heightInit[t] = xml.parseInt();
else if (tag == "nonshared_toolbars")
_toolbarNonsharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii());
else if (tag == "shared_toolbars")
_toolbarSharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii());
else if (tag == "shares_when_free")
_sharesWhenFree[t] = xml.parseInt();
else if (tag == "shares_when_subwin")
_sharesWhenSubwin[t] = xml.parseInt();
else if (tag == "default_subwin")
_defaultSubwin[t] = xml.parseInt();
else
xml.unknown("TopWin");
break;
case MusECore::Xml::TagEnd:
if (tag == "topwin")
return;
default:
break;
}
}
}
示例4: readStatus
void TopWin::readStatus(MusECore::Xml& xml)
{
int x=0, y=0, width=800, height=600;
for (;;)
{
MusECore::Xml::Token token = xml.parse();
if (token == MusECore::Xml::Error || token == MusECore::Xml::End)
break;
QString tag = xml.s1();
switch (token)
{
case MusECore::Xml::TagStart:
if (tag == "x")
x=xml.parseInt();
else if (tag == "y")
y=xml.parseInt();
else if (tag == "width")
width=xml.parseInt();
else if (tag == "height")
height=xml.parseInt();
else if (tag == "toolbars")
{
if (!sharesToolsAndMenu())
{
if (!restoreState(QByteArray::fromHex(xml.parse1().toAscii())))
{
fprintf(stderr,"ERROR: couldn't restore toolbars. trying default configuration...\n");
if (!restoreState(_toolbarNonsharedInit[_type]))
fprintf(stderr,"ERROR: couldn't restore default toolbars. this is not really a problem.\n");
}
}
else
{
_savedToolbarState=QByteArray::fromHex(xml.parse1().toAscii());
if (_savedToolbarState.isEmpty())
_savedToolbarState=_toolbarNonsharedInit[_type];
}
}
else if (tag == "shares_menu")
{
shareToolsAndMenu(xml.parseInt());
}
else if (tag == "is_subwin")
{
setIsMdiWin(xml.parseInt());
}
else
xml.unknown("TopWin");
break;
case MusECore::Xml::TagEnd:
if (tag == "topwin")
{
if (mdisubwin)
{
if(mdisubwin->isMaximized())
mdisubwin->showNormal();
mdisubwin->move(x, y);
mdisubwin->resize(width, height);
}
else
{
move(x,y);
resize(width,height);
}
return;
}
default:
break;
}
}
}