class YourCurve: public QwtPolarCurve
{
...
const QPointF &pole,
double radius,
const QRectF &canvasRect
) const {
if ( ( canvasRect.size() != m_image.size() ) || other_conditions_to_invalidate_the_image() )
{
m_image
= QImage( canvasRect.
size(),
QImage::Format_ARGB32_Premultiplied );
m_image.fill( 0 );
p.translate( -canvasRect.topLeft() );
QwtPloarCurve::draw( &p, azimuthMap, radialMap, pole, radius, canvasRect );
}
painter->drawImage( canvasRect.topLeft(), m_image );
}
};
class YourCurve: public QwtPolarCurve
{
...
virtual void draw( QPainter *painter,
const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
const QPointF &pole, double radius,
const QRectF &canvasRect ) const
{
if ( ( canvasRect.size() != m_image.size() ) || other_conditions_to_invalidate_the_image() )
{
m_image = QImage( canvasRect.size(), QImage::Format_ARGB32_Premultiplied );
m_image.fill( 0 );
QPainter p( &m_image );
p.translate( -canvasRect.topLeft() );
QwtPloarCurve::draw( &p, azimuthMap, radialMap, pole, radius, canvasRect );
}
painter->drawImage( canvasRect.topLeft(), m_image );
}
QImage m_image;
};
To copy to clipboard, switch view to plain text mode
Bookmarks