15 #include <qpainterpath.h> 87 #if QT_VERSION >= 0x050000 91 QPixmap::grabWidget(
this, rect() );
105 setAttribute( Qt::WA_OpaquePaintEvent,
true );
149 if ( event->type() == QEvent::PolishRequest )
157 setAttribute( Qt::WA_OpaquePaintEvent,
true );
161 if ( event->type() == QEvent::PolishRequest ||
162 event->type() == QEvent::StyleChange )
167 return QFrame::event( event );
176 QPainter painter(
this );
177 painter.setClipRegion( event->region() );
187 if ( testAttribute(Qt::WA_StyledBackground) )
207 if ( frameWidth() > 0 )
216 if ( testAttribute(Qt::WA_StyledBackground ) )
218 if ( testAttribute( Qt::WA_OpaquePaintEvent ) )
229 if ( testAttribute( Qt::WA_OpaquePaintEvent ) )
231 if ( autoFillBackground() )
241 QPainterPath clipPath;
242 clipPath.addRect( rect() );
243 clipPath = clipPath.subtracted(
borderPath( rect() ) );
247 painter.setClipPath( clipPath, Qt::IntersectClip );
257 if ( frameWidth() > 0 )
276 drawFrame( painter );
289 QFrame::resizeEvent( event );
302 repaint( contentsRect() );
304 update( contentsRect() );
322 #include "moc_qwt_plot_canvas.cpp"
Try to fill the complete contents rectangle of the plot canvas.
virtual void drawBackground(QPainter *)
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
virtual bool event(QEvent *) QWT_OVERRIDE
virtual void drawBorder(QPainter *) QWT_OVERRIDE
QwtPlotCanvas(QwtPlot *=NULL)
Constructor.
void drawCanvas(QPainter *)
double borderRadius() const
void drawUnstyled(QPainter *)
virtual ~QwtPlotCanvas()
Destructor.
FocusIndicator focusIndicator() const
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
bool testPaintAttribute(PaintAttribute) const
void drawStyled(QPainter *, bool)
Q_INVOKABLE QPainterPath borderPath(const QRect &) const
QwtPlotCanvas::PaintAttributes paintAttributes
const QPixmap * backingStore() const
static qreal devicePixelRatio(const QPaintDevice *)
PaintAttribute
Paint attributes.
void setPaintAttribute(PaintAttribute, bool on=true)
Changing the paint attributes.
QPainterPath borderPath2(const QRect &rect) const
virtual void drawBorder(QPainter *)
QwtPlot * plot()
Return parent plot widget.
Q_INVOKABLE void invalidateBackingStore()
Invalidate the internal backing store.
virtual void drawFocusIndicator(QPainter *)
void fillBackground(QPainter *)
void updateStyleSheetInfo()
Update the cached information about the current style sheet.
static QPixmap backingStore(QWidget *, const QSize &)
Try to improve painting of styled backgrounds.
Paint double buffered reusing the content of the pixmap buffer when possible.