Qt 4.8
Public Types | Public Functions | Static Public Functions | Protected Functions | Protected Variables | Friends | Related Functions | List of all members
QPaintDevice Class Referenceabstract

#include <qpaintdevice.h>

Inheritance diagram for QPaintDevice:
QCustomRasterPaintDevice QFakeDevice QFakeDevice QGLFramebufferObject QGLPaintDevice QGLPixelBuffer QImage QMacQuartzPaintDevice QPaintBuffer QPicture QPixmap QPrinter QSvgGenerator QVGWindowSurface QWidget ShivaVGWindowSurface

Public Types

enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 

Public Functions

int colorCount () const
 
int depth () const
 
virtual int devType () const
 
virtual HDC getDC () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
virtual QPaintEnginepaintEngine () const =0
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
virtual void releaseDC (HDC hdc) const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Static Public Functions

static QWSDisplayqwsDisplay ()
 

Protected Functions

virtual int metric (PaintDeviceMetric metric) const
 
 QPaintDevice ()
 

Protected Variables

ushort painters
 

Friends

class QFontEngineMac
 
class QPainter
 
Q_GUI_EXPORT int qt_paint_device_metric (const QPaintDevice *device, PaintDeviceMetric metric)
 
class QX11PaintEngine
 

Related Functions

(Note that these are not member functions.)

const Q_GUI_EXPORT QX11Infoqt_x11Info (const QPaintDevice *pd)
 Returns the QX11Info structure for the pd paint device. More...
 

Detailed Description

Definition at line 60 of file qpaintdevice.h.

Enumerations

◆ PaintDeviceMetric

Enumerator
PdmWidth 
PdmHeight 
PdmWidthMM 
PdmHeightMM 
PdmNumColors 
PdmDepth 
PdmDpiX 
PdmDpiY 
PdmPhysicalDpiX 
PdmPhysicalDpiY 

Definition at line 63 of file qpaintdevice.h.

Constructors and Destructors

◆ ~QPaintDevice()

QPaintDevice::~QPaintDevice ( )
virtual

Definition at line 53 of file qpaintdevice.cpp.

54 {
55  if (paintingActive())
56  qWarning("QPaintDevice: Cannot destroy paint device that is being "
57  "painted");
59 }
bool paintingActive() const
Definition: qpaintdevice.h:170
Q_CORE_EXPORT void qWarning(const char *,...)
void qt_painter_removePaintDevice(QPaintDevice *)
Definition: qpainter.cpp:8419

◆ QPaintDevice()

QPaintDevice::QPaintDevice ( )
protected

Definition at line 48 of file qpaintdevice.cpp.

Referenced by QPixmap::handle(), QImage::QImage(), and QWidget::QWidget().

49 {
50  painters = 0;
51 }
ushort painters
Definition: qpaintdevice.h:109

Functions

◆ colorCount()

int QPaintDevice::colorCount ( ) const
inline

Definition at line 102 of file qpaintdevice.h.

Referenced by QImage::copy().

102 { return metric(PdmNumColors); }
virtual int metric(PaintDeviceMetric metric) const

◆ depth()

int QPaintDevice::depth ( ) const
inline

◆ devType()

int QPaintDevice::devType ( ) const
inlinevirtual

◆ getDC()

HDC QPaintDevice::getDC ( ) const
virtual
Warning
This function is not part of the public interface.

Reimplemented in QWidget, and QPrinter.

Definition at line 53 of file qpaintdevice_win.cpp.

Referenced by QFont::QFont().

54 {
55  return 0;
56 }

◆ height()

int QPaintDevice::height ( ) const
inline

◆ heightMM()

int QPaintDevice::heightMM ( ) const
inline

Definition at line 94 of file qpaintdevice.h.

Referenced by QPSPrintEnginePrivate::emitHeader().

94 { return metric(PdmHeightMM); }
virtual int metric(PaintDeviceMetric metric) const

◆ logicalDpiX()

int QPaintDevice::logicalDpiX ( ) const
inline

◆ logicalDpiY()

int QPaintDevice::logicalDpiY ( ) const
inline

◆ metric()

int QPaintDevice::metric ( PaintDeviceMetric  metric) const
protectedvirtual

◆ numColors()

QT_DEPRECATED int QPaintDevice::numColors ( ) const
inline

Definition at line 100 of file qpaintdevice.h.

Referenced by QImage::copy(), QDirectFBPaintDevice::metric(), and QApplication::qwsSetCustomColors().

100 { return metric(PdmNumColors); }
virtual int metric(PaintDeviceMetric metric) const

◆ paintEngine()

virtual QPaintEngine* QPaintDevice::paintEngine ( ) const
pure virtual

◆ paintingActive()

bool QPaintDevice::paintingActive ( ) const
inline

◆ physicalDpiX()

int QPaintDevice::physicalDpiX ( ) const
inline

Definition at line 97 of file qpaintdevice.h.

97 { return metric(PdmPhysicalDpiX); }
virtual int metric(PaintDeviceMetric metric) const

◆ physicalDpiY()

int QPaintDevice::physicalDpiY ( ) const
inline

Definition at line 98 of file qpaintdevice.h.

98 { return metric(PdmPhysicalDpiY); }
virtual int metric(PaintDeviceMetric metric) const

◆ qwsDisplay()

QWSDisplay * QPaintDevice::qwsDisplay ( )
static

◆ releaseDC()

void QPaintDevice::releaseDC ( HDC  hdc) const
virtual
Warning
This function is not part of the public interface.

Reimplemented in QWidget, and QPrinter.

Definition at line 58 of file qpaintdevice_win.cpp.

59 {
60 }

◆ width()

int QPaintDevice::width ( ) const
inline

◆ widthMM()

int QPaintDevice::widthMM ( ) const
inline

Definition at line 93 of file qpaintdevice.h.

Referenced by QPSPrintEnginePrivate::emitHeader().

93 { return metric(PdmWidthMM); }
virtual int metric(PaintDeviceMetric metric) const

Friends and Related Functions

◆ QFontEngineMac

friend class QFontEngineMac
friend

Definition at line 141 of file qpaintdevice.h.

◆ QPainter

friend class QPainter
friend

Definition at line 140 of file qpaintdevice.h.

◆ qt_paint_device_metric

Q_GUI_EXPORT int qt_paint_device_metric ( const QPaintDevice device,
QPaintDevice::PaintDeviceMetric  metric 
)
friend

Definition at line 70 of file qpaintdevice.cpp.

Referenced by ShivaVGWindowSurface::metric(), and QVGWindowSurface::metric().

71 {
72  return device->metric(metric);
73 }
virtual int metric(PaintDeviceMetric metric) const

◆ qt_x11Info()

const Q_GUI_EXPORT QX11Info * qt_x11Info ( const QPaintDevice pd)
related

Returns the QX11Info structure for the pd paint device.

0 is returned if it can't be obtained.

Definition at line 80 of file qpaintdevice_x11.cpp.

81 {
82  if (!pd) return 0;
83  if (pd->devType() == QInternal::Widget)
84  return &static_cast<const QWidget *>(pd)->x11Info();
85  else if (pd->devType() == QInternal::Pixmap)
86  return &static_cast<const QPixmap *>(pd)->x11Info();
87  return 0;
88 }
virtual int devType() const
Definition: qpaintdevice.h:167

◆ QX11PaintEngine

friend class QX11PaintEngine
friend

Definition at line 142 of file qpaintdevice.h.

Properties

◆ painters

ushort QPaintDevice::painters
protected

Definition at line 109 of file qpaintdevice.h.

Referenced by QPainter::begin(), and QPaintDevice().


The documentation for this class was generated from the following files: