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