本文整理汇总了C++中KMPrinter::setDevice方法的典型用法代码示例。如果您正苦于以下问题:C++ KMPrinter::setDevice方法的具体用法?C++ KMPrinter::setDevice怎么用?C++ KMPrinter::setDevice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KMPrinter
的用法示例。
在下文中一共展示了KMPrinter::setDevice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
KMPrinter *KMFoomaticManager::createPrinterFromElement(QDomElement *elem)
{
QDomElement e = elem->namedItem("name").toElement();
if(!e.isNull())
{
KMPrinter *printer = new KMPrinter;
printer->setType(KMPrinter::Printer);
printer->setName(e.text());
printer->setPrinterName(e.text());
printer->setState(KMPrinter::Idle);
/*if (printer->name().find('/') != -1)
{
QString s(printer->name());
int p = s.find('/');
printer->setPrinterName(s.left(p));
printer->setInstanceName(s.mid(p+1));
printer->addType(KMPrinter::Virtual);
}*/
if(!(e = elem->namedItem("description").toElement()).isNull())
printer->setDescription(e.text());
if(!(e = elem->namedItem("location").toElement()).isNull())
printer->setLocation(e.text());
if(!(e = elem->namedItem("connect").toElement()).isNull())
printer->setDevice(e.text());
printer->setOption("foomatic", elem->attribute("foomatic"));
printer->setOption("spooler", elem->attribute("spooler"));
if(elem->attribute("foomatic") == "1")
{
if(!(e = elem->namedItem("printer").toElement()).isNull())
printer->setOption("printer", e.text());
if(!(e = elem->namedItem("driver").toElement()).isNull())
printer->setOption("driver", e.text());
}
return printer;
}
return NULL;
}