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 );
99 return qobject_cast< QwtPolarPlot* >( parent() );
105 return qobject_cast< QwtPolarPlot* >( parent() );
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 );
274 const QPointF center = pl->
plotRect().center();
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"