本文整理汇总了C++中QLCInputProfile::model方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCInputProfile::model方法的具体用法?C++ QLCInputProfile::model怎么用?C++ QLCInputProfile::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCInputProfile
的用法示例。
在下文中一共展示了QLCInputProfile::model方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: model
void QLCInputProfile_Test::model()
{
QLCInputProfile ip;
QVERIFY(ip.model() == QString::null);
ip.setModel("BCF2000");
QVERIFY(ip.model() == "BCF2000");
}
示例2: model
void QLCInputProfile_Test::model()
{
QLCInputProfile ip;
QVERIFY(ip.model().isEmpty());
ip.setModel("BCF2000");
QVERIFY(ip.model() == "BCF2000");
}
示例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: save
void QLCInputProfile_Test::save()
{
QLCInputProfile ip;
ip.setManufacturer("TestManufacturer");
ip.setModel("TestModel");
QLCInputChannel* ich1 = new QLCInputChannel();
ich1->setName("Channel 1");
ip.insertChannel(0, ich1);
QLCInputChannel* ich2 = new QLCInputChannel();
ich2->setName("Channel 2");
ip.insertChannel(5, ich2);
QLCInputChannel* ich3 = new QLCInputChannel();
ich3->setName("Channel 3");
ip.insertChannel(2, ich3);
QString path("test.qxi");
QVERIFY(ip.saveXML(path) == true);
#if !defined(WIN32) && !defined(Q_OS_WIN)
QFile::Permissions perm = QFile::permissions(path);
QFile::setPermissions(path, 0);
QVERIFY(ip.saveXML(path) == false);
QFile::setPermissions(path, perm);
#endif
QLCInputProfile* prof = QLCInputProfile::loader(path);
QVERIFY(prof != NULL);
QCOMPARE(prof->manufacturer(), ip.manufacturer());
QCOMPARE(prof->model(), ip.model());
QCOMPARE(prof->name(), ip.name());
QCOMPARE(prof->channels().size(), ip.channels().size());
QCOMPARE(prof->channels()[0]->name(), ich1->name());
QCOMPARE(prof->channels()[2]->name(), ich3->name());
QCOMPARE(prof->channels()[5]->name(), ich2->name());
QVERIFY(QFile::remove(path) == true);
delete prof;
}
示例5: copy
void QLCInputProfile_Test::copy()
{
QLCInputProfile ip;
ip.setManufacturer("Behringer");
ip.setModel("BCF2000");
QLCInputChannel* ich1 = new QLCInputChannel();
ich1->setName("Channel 1");
ip.insertChannel(0, ich1);
QLCInputChannel* ich2 = new QLCInputChannel();
ich2->setName("Channel 2");
ip.insertChannel(5, ich2);
QLCInputChannel* ich3 = new QLCInputChannel();
ich3->setName("Channel 3");
ip.insertChannel(2, ich3);
QLCInputChannel* ich4 = new QLCInputChannel();
ich4->setName("Channel 4");
ip.insertChannel(9000, ich4);
QLCInputProfile copy = ip;
QVERIFY(copy.manufacturer() == "Behringer");
QVERIFY(copy.model() == "BCF2000");
QVERIFY(copy.channels().size() == 4);
/* Verify that it's a deep copy */
QVERIFY(copy.channel(0) != ich1);
QVERIFY(copy.channel(0) != NULL);
QVERIFY(copy.channel(0)->name() == "Channel 1");
QVERIFY(copy.channel(5) != ich2);
QVERIFY(copy.channel(5) != NULL);
QVERIFY(copy.channel(5)->name() == "Channel 2");
QVERIFY(copy.channel(2) != ich3);
QVERIFY(copy.channel(2) != NULL);
QVERIFY(copy.channel(2)->name() == "Channel 3");
QVERIFY(copy.channel(9000) != ich4);
QVERIFY(copy.channel(9000) != NULL);
QVERIFY(copy.channel(9000)->name() == "Channel 4");
}
示例6: 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);
}