15 #include <qpainterpath.h> 52 setFrameShadow( QFrame::Sunken );
53 setFrameShape( QFrame::Panel );
91 #if QT_VERSION >= 0x050000 95 QPixmap::grabWidget(
this, rect() );
109 setAttribute( Qt::WA_OpaquePaintEvent,
true );
153 if ( event->type() == QEvent::PolishRequest )
161 setAttribute( Qt::WA_OpaquePaintEvent,
true );
165 if ( event->type() == QEvent::PolishRequest ||
166 event->type() == QEvent::StyleChange )
171 return QFrame::event( event );
180 QPainter painter(
this );
181 painter.setClipRegion( event->region() );
191 if ( testAttribute(Qt::WA_StyledBackground) )
211 if ( frameWidth() > 0 )
220 if ( testAttribute(Qt::WA_StyledBackground ) )
222 if ( testAttribute( Qt::WA_OpaquePaintEvent ) )
233 if ( testAttribute( Qt::WA_OpaquePaintEvent ) )
235 if ( autoFillBackground() )
245 QPainterPath clipPath;
246 clipPath.addRect( rect() );
247 clipPath = clipPath.subtracted(
borderPath( rect() ) );
251 painter.setClipPath( clipPath, Qt::IntersectClip );
261 if ( frameWidth() > 0 )
280 drawFrame( painter );
293 QFrame::resizeEvent( event );
306 repaint( contentsRect() );
326 #include "moc_qwt_plot_canvas.cpp" QPainterPath canvasBorderPath(const QRect &rect) const
Try to fill the complete contents rectangle of the plot canvas.
virtual void drawBackground(QPainter *)
Helper function for the derived plot canvas.
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
virtual bool event(QEvent *) QWT_OVERRIDE
bool testPaintAttribute(PaintAttribute) const
virtual void drawBorder(QPainter *) QWT_OVERRIDE
QwtPlotCanvas(QwtPlot *=NULL)
Constructor.
void drawCanvas(QPainter *)
Draw the plot to the canvas.
void drawUnstyled(QPainter *)
Helper function for the derived plot canvas.
virtual ~QwtPlotCanvas()
Destructor.
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
void drawStyled(QPainter *, bool)
Helper function for the derived plot canvas.
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
double borderRadius() const
QwtPlotCanvas::PaintAttributes paintAttributes
static qreal devicePixelRatio(const QPaintDevice *)
const QPixmap * backingStore() const
Q_INVOKABLE QPainterPath borderPath(const QRect &) const
PaintAttribute
Paint attributes.
void setPaintAttribute(PaintAttribute, bool on=true)
Changing the paint attributes.
FocusIndicator focusIndicator() const
virtual void drawBorder(QPainter *)
QwtPlot * plot()
Return parent plot widget.
Base class for all type of plot canvases.
span_constexpr std::size_t size(span< T, Extent > const &spn)
Q_INVOKABLE void invalidateBackingStore()
Invalidate the internal backing store.
virtual void drawFocusIndicator(QPainter *)
void fillBackground(QPainter *)
Helper function for the derived plot canvas.
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.