当前位置: 首页>>代码示例>>C++>>正文


C++ QLCInputProfile::loadXML方法代码示例

本文整理汇总了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);
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:10,代码来源:qlcinputprofile_test.cpp

示例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);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:14,代码来源:qlcinputprofile_test.cpp

示例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);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:31,代码来源:qlcinputprofile_test.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:38,代码来源:


注:本文中的QLCInputProfile::loadXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。