45 #include "private/qt_mac_p.h" 58 if (PMServerCreatePrinterList(kPMServerLocal, &array) == noErr) {
59 CFIndex count = CFArrayGetCount(array);
60 for (
int i = 0; i < count; ++i) {
61 PMPrinter printer =
static_cast<PMPrinter
>(
const_cast<void *
>(CFArrayGetValueAtIndex(array, i)));
65 if (PMPrinterIsDefault(printer))
67 printers.
append(printerInfo);
82 return printers.
value(0);
98 if (PMPrinterGetPaperList(cfPrn, &array) != noErr) {
103 int count = CFArrayGetCount(array);
104 for (
int i = 0; i < count; ++i) {
105 PMPaper paper =
static_cast<PMPaper
>(
const_cast<void *
>(CFArrayGetValueAtIndex(array, i)));
106 double width, height;
107 if (PMPaperGetWidth(paper, &width) == noErr && PMPaperGetHeight(paper, &height) == noErr) {
108 QSizeF size(width * 0.3527, height * 0.3527);
118 #endif // QT_NO_PRINTER
QPrinter::PaperSize qSizeFTopaperSize(const QSizeF &size)
static QPrinterInfo defaultPrinter()
Returns the default printer on the system.
QList< QPrinter::PaperSize > supportedPaperSizes() const
Returns a list of supported paper sizes by the printer.
#define QT_END_NAMESPACE
This macro expands to.
static CFStringRef toCFStringRef(const QString &str)
static QString toQString(CFStringRef cfstr)
The QString class provides a Unicode character string.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
T value(int i) const
Returns the value at index position i in the list.
bool isDefault() const
Returns whether this printer is the default printer.
The QPrinterInfo class gives access to information about existing printers.
QString printerName() const
Returns the name of the printer.
QScopedPointer< QPrinterInfoPrivate, QPrinterInfoPrivateDeleter > d_ptr
PaperSize
This enum type specifies what paper size QPrinter should use.
static QList< QPrinterInfo > availablePrinters()
Returns a list of available printers on the system.
bool isNull() const
Returns whether this QPrinterInfo object holds a printer definition.
const struct __CFArray * CFArrayRef
The QList class is a template class that provides lists.