40 case QPaintDevice::PdmWidth:
41 return mDrawingSize.width();
42 case QPaintDevice::PdmHeight:
43 return mDrawingSize.height();
44 case QPaintDevice::PdmWidthMM:
45 return mDrawingSize.width();
46 case QPaintDevice::PdmHeightMM:
47 return mDrawingSize.height();
48 case QPaintDevice::PdmNumColors:
49 return std::numeric_limits<int>::max();
50 case QPaintDevice::PdmDepth:
52 case QPaintDevice::PdmDpiX:
53 case QPaintDevice::PdmDpiY:
54 case QPaintDevice::PdmPhysicalDpiX:
55 case QPaintDevice::PdmPhysicalDpiY:
57 case QPaintDevice::PdmDevicePixelRatio:
59 #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) 60 case QPaintDevice::PdmDevicePixelRatioScaled:
69 if ( !mDrawingSize.isValid() || mRectangle.isEmpty() )
74 double widthFactor = mRectangle.width() / mDrawingSize.width();
75 double heightFactor = mRectangle.height() / mDrawingSize.height();
76 return ( widthFactor + heightFactor ) / 2.0;
81 if ( !mDrawingSize.isValid() || mRectangle.isEmpty() )
83 return QPointF( pt.x(), pt.y() );
86 double x = mRectangle.left() + pt.x() * ( mRectangle.width() / mDrawingSize.width() );
87 double y = mRectangle.bottom() - pt.y() * ( mRectangle.height() / mDrawingSize.height() );
88 return QPointF( x, y );
QPaintEngine * paintEngine() const override
~QgsDxfPaintDevice() override
void setLayer(const QString &layer)
void setShift(QPointF shift)
void setShift(QPointF shift)
QPointF dxfCoordinates(QPointF pt) const
Converts a point from device coordinates to dxf coordinates.
double widthScaleFactor() const
Returns scale factor for line width.
void setLayer(const QString &layer)
QgsDxfPaintDevice(QgsDxfExport *dxf)
int metric(PaintDeviceMetric metric) const override