Qt 4.8
Functions
qprintengine_mac.mm File Reference
#include <private/qprintengine_mac_p.h>
#include <qthread.h>
#include <quuid.h>
#include <QtCore/qcoreapplication.h>

Go to the source code of this file.

Functions

static int qt_get_PDMHeight (PMPageFormat pformat, bool fullPage, const PMResolution &resolution)
 
static int qt_get_PDMWidth (PMPageFormat pformat, bool fullPage, const PMResolution &resolution)
 
QSizeF qt_paperSizeToQSizeF (QPrinter::PaperSize size)
 

Function Documentation

◆ qt_get_PDMHeight()

static int qt_get_PDMHeight ( PMPageFormat  pformat,
bool  fullPage,
const PMResolution &  resolution 
)
inlinestatic

Definition at line 323 of file qprintengine_mac.mm.

Referenced by QMacPrintEngine::metric().

325 {
326  int val = 0;
327  PMRect r;
328  qreal vRatio = resolution.vRes / 72;
329  if (fullPage) {
330  if (PMGetAdjustedPaperRect(pformat, &r) == noErr)
331  val = qRound((r.bottom - r.top) * vRatio);
332  } else {
333  if (PMGetAdjustedPageRect(pformat, &r) == noErr)
334  val = qRound((r.bottom - r.top) * vRatio);
335  }
336  return val;
337 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ qt_get_PDMWidth()

static int qt_get_PDMWidth ( PMPageFormat  pformat,
bool  fullPage,
const PMResolution &  resolution 
)
inlinestatic

Definition at line 307 of file qprintengine_mac.mm.

Referenced by QMacPrintEngine::metric().

309 {
310  int val = 0;
311  PMRect r;
312  qreal hRatio = resolution.hRes / 72;
313  if (fullPage) {
314  if (PMGetAdjustedPaperRect(pformat, &r) == noErr)
315  val = qRound((r.right - r.left) * hRatio);
316  } else {
317  if (PMGetAdjustedPageRect(pformat, &r) == noErr)
318  val = qRound((r.right - r.left) * hRatio);
319  }
320  return val;
321 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ qt_paperSizeToQSizeF()

QSizeF qt_paperSizeToQSizeF ( QPrinter::PaperSize  size)

Definition at line 2615 of file qprinter.cpp.

Referenced by QMacPrintEnginePrivate::paperSize(), and QMacPrintEnginePrivate::setPaperSize().

2616 {
2617  if (size == QPrinter::Custom) return QSizeF(0, 0);
2618  return QSizeF(qt_paperSizes[size][0], qt_paperSizes[size][1]);
2619 }
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
static const float qt_paperSizes[][2]
Definition: qprinter.cpp:89