本文整理汇总了C++中QLCInputProfile::loadXML方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCInputProfile::loadXML方法的具体用法?C++ QLCInputProfile::loadXML怎么用?C++ QLCInputProfile::loadXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCInputProfile
的用法示例。
在下文中一共展示了QLCInputProfile::loadXML方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadNoProfile
void QLCInputProfile_Test::loadNoProfile()
{
QDomDocument doc;
QLCInputProfile ip;
QVERIFY(ip.loadXML(doc) == false);
QDomElement root = doc.createElement("Whatever");
doc.appendChild(root);
QVERIFY(ip.loadXML(doc) == false);
}
示例2: loadNoProfile
void QLCInputProfile_Test::loadNoProfile()
{
QXmlStreamReader doc;
QLCInputProfile ip;
QVERIFY(ip.loadXML(doc) == false);
QBuffer buffer;
buffer.open(QIODevice::ReadWrite);
QXmlStreamWriter xmlWriter(&buffer);
xmlWriter.writeStartElement("Whatever");
doc.setDevice(&buffer);
QVERIFY(ip.loadXML(doc) == false);
}
示例3: load
void QLCInputProfile_Test::load()
{
QBuffer buffer;
buffer.open(QIODevice::WriteOnly | QIODevice::Text);
QXmlStreamWriter xmlWriter(&buffer);
xmlWriter.writeStartDocument();
xmlWriter.writeDTD("<!DOCTYPE InputProfile>");
xmlWriter.writeStartElement("InputProfile");
xmlWriter.writeTextElement("Manufacturer", "Behringer");
xmlWriter.writeTextElement("Model", "BCF2000");
xmlWriter.writeStartElement("Channel");
xmlWriter.writeAttribute("Number", "492");
xmlWriter.writeTextElement("Name", "Foobar");
xmlWriter.writeTextElement("Type", "Slider");
xmlWriter.writeEndDocument();
xmlWriter.setDevice(NULL);
buffer.close();
buffer.open(QIODevice::ReadOnly | QIODevice::Text);
QXmlStreamReader xmlReader(&buffer);
QLCInputProfile ip;
QVERIFY(ip.loadXML(xmlReader) == true);
QVERIFY(ip.manufacturer() == "Behringer");
QVERIFY(ip.model() == "BCF2000");
QVERIFY(ip.channels().size() == 1);
QVERIFY(ip.channel(492) != NULL);
QVERIFY(ip.channel(492)->name() == "Foobar");
QVERIFY(ip.channel(492)->type() == QLCInputChannel::Slider);
}
示例4: load
void QLCInputProfile_Test::load()
{
QDomDocument doc;
QDomElement profile = doc.createElement("InputProfile");
QDomElement manuf = doc.createElement("Manufacturer");
QDomText manufText = doc.createTextNode("Behringer");
manuf.appendChild(manufText);
profile.appendChild(manuf);
QDomElement model = doc.createElement("Model");
QDomText modelText = doc.createTextNode("BCF2000");
model.appendChild(modelText);
profile.appendChild(model);
doc.appendChild(profile);
QDomElement ch = doc.createElement("Channel");
ch.setAttribute("Number", 492);
profile.appendChild(ch);
QDomElement name = doc.createElement("Name");
QDomText nameText = doc.createTextNode("Foobar");
name.appendChild(nameText);
ch.appendChild(name);
QDomElement type = doc.createElement("Type");
QDomText typeText = doc.createTextNode("Slider");
type.appendChild(typeText);
ch.appendChild(type);
QLCInputProfile ip;
QVERIFY(ip.loadXML(&doc) == true);
QVERIFY(ip.manufacturer() == "Behringer");
QVERIFY(ip.model() == "BCF2000");
QVERIFY(ip.channels().size() == 1);
QVERIFY(ip.channel(492) != NULL);
QVERIFY(ip.channel(492)->name() == "Foobar");
QVERIFY(ip.channel(492)->type() == QLCInputChannel::Slider);
}