42 .convertToFormat( QImage::Format_Indexed8, Qt::OrderedDither | Qt::OrderedAlphaDither );
68 double nw = br.
width() * 0.5;
69 double nh = br.
height() * 0.5;
73 nw = br.
width() * 0.5;
A rectangle specified with double values.
QgsRectangle rect() const
returns canvas item rectangle in map units
An abstract class for items that can be placed on the map canvas.
void drawLine(const QLineF &line)
Map canvas is a class for displaying all GIS data types on a canvas.
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
virtual QRectF boundingRect() const override
default implementation for canvas items
QVariant property(const char *name) const
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
Q_DECL_DEPRECATED QPaintDevice & paintDevice()
void setRect(const QgsRectangle &r, bool resetRotation=true)
sets canvas item rectangle in map units
virtual void paint(QPainter *painter) override
function to be implemented by derived classes
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
void setContent(const QImage &image, const QgsRectangle &rect)
QgsMapCanvas * mMapCanvas
pointer to map canvas
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QgsMapCanvasMap(QgsMapCanvas *canvas)
constructor
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const