18 const QRectF &rect,
const QSizeF &itemSize )
21 if ( renderFlags & Qt::AlignLeft )
25 else if ( renderFlags & Qt::AlignRight )
27 x = rect.right() - itemSize.width();
31 x = rect.center().x() - 0.5 * itemSize.width();
35 if ( renderFlags & Qt::AlignTop )
39 else if ( renderFlags & Qt::AlignBottom )
41 y = rect.bottom() - itemSize.height();
45 y = rect.center().y() - 0.5 * itemSize.height();
48 return QRect( x, y, itemSize.width(), itemSize.height() );
146 margin = qMax( margin, 0 );
176 const QRectF &canvasRect )
const 183 const QRectF rect =
textRect( canvasRect.adjusted( m, m, -m, -m ),
189 switch( painter->paintEngine()->type() )
191 case QPaintEngine::Picture:
192 case QPaintEngine::User:
214 pixmapRect.setLeft( qFloor( rect.left() ) - pw );
215 pixmapRect.setTop( qFloor( rect.top() ) - pw );
216 pixmapRect.setRight( qCeil( rect.right() ) + pw );
217 pixmapRect.setBottom( qCeil( rect.bottom() ) + pw );
219 #if QT_VERSION >= 0x050000 221 const QSize scaledSize = pixmapRect.size() * pixelRatio;
223 const QSize scaledSize = pixmapRect.size();
230 #if QT_VERSION >= 0x050000 235 const QRect r( pw, pw,
236 pixmapRect.width() - 2 * pw, pixmapRect.height() - 2 * pw );
262 const QRectF &rect,
const QSizeF &textSize )
const static QRect qwtItemRect(int renderFlags, const QRectF &rect, const QSizeF &itemSize)
virtual void draw(QPainter *, const QwtScaleMap &, const QwtScaleMap &, const QRectF &) const
QwtPlotTextLabel()
Constructor.
void setMargin(int margin)
void draw(QPainter *painter, const QRectF &rect) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
The item is represented on the legend.
QSizeF textSize(const QFont &=QFont()) const
virtual QRectF textRect(const QRectF &, const QSizeF &) const
Align the text label.
static qreal devicePixelRatio(const QPaintDevice *)
A class representing a text.
void setZ(double z)
Set the z value.
void setText(const QwtText &)
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual void itemChanged()
void invalidateCache()
Invalidate all internal cache.
Base class for items on the plot canvas.
void setItemAttribute(ItemAttribute, bool on=true)
virtual ~QwtPlotTextLabel()
Destructor.
static bool roundingAlignment()