17 #include <qstyleoption.h> 19 #include <qx11info_x11.h> 23 QWidget *widget, QPainter *painter )
26 opt.initFrom( widget );
27 widget->style()->drawPrimitive( QStyle::PE_Widget, &opt, painter, widget );
32 if ( w->parentWidget() == NULL )
35 if ( w->autoFillBackground() )
37 const QBrush brush = w->palette().brush( w->backgroundRole() );
38 if ( brush.color().alpha() > 0 )
42 if ( w->testAttribute( Qt::WA_StyledBackground ) )
44 QImage image( 1, 1, QImage::Format_ARGB32 );
45 image.fill( Qt::transparent );
47 QPainter painter( &image );
48 painter.translate( -w->rect().center() );
52 if ( qAlpha( image.pixel( 0, 0 ) ) != 0 )
83 setCursor( Qt::CrossCursor );
85 setFocusPolicy( Qt::WheelFocus );
139 const QRect cr = contentsRect();
140 #if QT_VERSION >= 0x050000 188 QPainter painter(
this );
189 painter.setClipRegion( event->region() );
195 if ( bs.size() != size() )
197 bs = QPixmap( size() );
199 if ( bs.x11Info().screen() != x11Info().screen() )
200 bs.x11SetScreen( x11Info().screen() );
205 if ( testAttribute( Qt::WA_StyledBackground ) )
212 if ( autoFillBackground() )
215 p.fillRect( rect(), palette().brush( backgroundRole() ) );
222 mapTo( bgWidget, rect().topLeft() ) );
230 if ( frameWidth() > 0 )
242 if ( frameWidth() > 0 )
243 drawFrame( &painter );
253 QFrame::resizeEvent( event );
276 double dx = pos.x() - center.x();
277 double dy = -( pos.y() - center.y() );
284 double min = azimuthMap.
s1();
285 double max = azimuthMap.
s2();
291 azimuth += max -
min;
293 else if ( azimuth > max )
295 azimuth -= max -
min;
321 pl->
plotRect().center(), radius, azimuth );
323 return pos.toPoint();
327 #include "moc_qwt_polar_canvas.cpp"
A plotting widget, displaying a polar coordinate system.
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
bool testPaintAttribute(PaintAttribute) const
A point in polar coordinates.
QwtPolarCanvas(QwtPolarPlot *)
Constructor.
virtual ~QwtPolarCanvas()
Destructor.
void updateScale(int scaleId)
QPoint qwtPolar2Pos(const QPoint &pole, double radius, double angle)
double radius() const
Returns the radius.
static QWidget * qwtBackgroundWidget(QWidget *w)
QwtPointPolar invTransform(const QPoint &) const
QwtPolarCanvas::PaintAttributes paintAttributes
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
void invalidateBackingStore()
Invalidate the internal backing store.
virtual void drawCanvas(QPainter *, const QRectF &) const
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
static void qwtDrawStyledBackground(QWidget *widget, QPainter *painter)
double azimuth() const
Returns the azimuth.
QwtScaleMap scaleMap(int scaleId, double radius) const
QPoint transform(const QwtPointPolar &) const
const QPixmap * backingStore() const
double invTransform(double p) const
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
double transform(double s) const
void setPaintAttribute(PaintAttribute, bool on=true)
Changing the paint attributes.
PaintAttribute
Paint attributes.
QwtPointPolar normalized() const