Esempio n. 1
0
bool FilePrinter::cupsAvailable()
{
#ifdef Q_WS_X11
    // Ideally we would have access to the private Qt method
    // QCUPSSupport::cupsAvailable() to do this as it is very complex routine.
    // However, if CUPS is available then QPrinter::numCopies() will always return 1
    // whereas if CUPS is not available it will return the real number of copies.
    // This behaviour is guaranteed never to change, so we can use it as a reliable substitute.
    QPrinter testPrinter;
    testPrinter.setNumCopies( 2 );
    return ( testPrinter.numCopies() == 1 );
#else
    return false;
#endif
}
Esempio n. 2
0
void QPrinterProto::setNumCopies(int numCopies)
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    item->setNumCopies(numCopies);
}
Esempio n. 3
0
int Printer::setNumCopies(lua_State * L) // ( int numCopies )
{
	QPrinter* lhs = ValueBinding<MyQPrinter>::check( L, 1 );
	lhs->setNumCopies( Util::toInt( L, 2 ) );
	return 0;
}