77QPrinterInfo::QPrinterInfo(
const QPrinter &printer)
80 QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
82 QPrinterInfo pi(printer.printerName());
83 if (pi.d_ptr.data() == shared_null)
84 d_ptr.reset(shared_null);
86 d_ptr.reset(
new QPrinterInfoPrivate(*pi.d_ptr));
307QList<QPrinter::DuplexMode> QPrinterInfo::supportedDuplexModes()
const
309 Q_D(
const QPrinterInfo);
310 QList<QPrinter::DuplexMode> list;
311 const auto supportedDuplexModes = d->m_printDevice.supportedDuplexModes();
312 list.reserve(supportedDuplexModes.size());
313 for (QPrint::DuplexMode mode : supportedDuplexModes)
314 list << QPrinter::DuplexMode(mode);
336QList<QPrinter::ColorMode> QPrinterInfo::supportedColorModes()
const
338 Q_D(
const QPrinterInfo);
339 QList<QPrinter::ColorMode> list;
340 const auto supportedColorModes = d->m_printDevice.supportedColorModes();
341 list.reserve(supportedColorModes.size());
342 for (QPrint::ColorMode mode : supportedColorModes)
343 list << QPrinter::ColorMode(mode);
377QList<QPrinterInfo> QPrinterInfo::availablePrinters()
379 QList<QPrinterInfo> list;
380 QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
382 const QStringList availablePrintDeviceIds = ps->availablePrintDeviceIds();
383 list.reserve(availablePrintDeviceIds.size());
384 for (
const QString &id : availablePrintDeviceIds)
385 list.append(QPrinterInfo(id));