Qt 4.8
Functions
qprinterinfo_mac.cpp File Reference
#include "qprinterinfo.h"
#include "qprinterinfo_p.h"
#include "private/qt_mac_p.h"

Go to the source code of this file.

Functions

QPrinter::PaperSize qSizeFTopaperSize (const QSizeF &size)
 

Function Documentation

◆ qSizeFTopaperSize()

QPrinter::PaperSize qSizeFTopaperSize ( const QSizeF size)

Definition at line 2629 of file qprinter.cpp.

Referenced by QPrinterInfo::supportedPaperSizes().

2630 {
2631  for (int i = 0; i < static_cast<int>(QPrinter::NPaperSize); ++i) {
2632  if (qt_paperSizes[i][0] >= size.width() - 1 &&
2633  qt_paperSizes[i][0] <= size.width() + 1 &&
2634  qt_paperSizes[i][1] >= size.height() - 1 &&
2635  qt_paperSizes[i][1] <= size.height() + 1) {
2636  return QPrinter::PaperSize(i);
2637  }
2638  }
2639 
2640  return QPrinter::Custom;
2641 }
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
PaperSize
This enum type specifies what paper size QPrinter should use.
Definition: qprinter.h:91
static const float qt_paperSizes[][2]
Definition: qprinter.cpp:89