Qwt User's Guide  6.2.0
qwt_plot_canvas.h
1 /******************************************************************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_PLOT_CANVAS_H
11 #define QWT_PLOT_CANVAS_H
12 
13 #include "qwt_global.h"
14 #include "qwt_plot_abstract_canvas.h"
15 
16 #include <qframe.h>
17 
18 class QwtPlot;
19 class QPixmap;
20 class QPainterPath;
21 
29 class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
30 {
31  Q_OBJECT
32 
33  Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
34 
35  public:
36 
45  {
57  BackingStore = 1,
58 
74  Opaque = 2,
75 
91  HackStyledBackground = 4,
92 
99  ImmediatePaint = 8
100  };
101 
102  Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
103 
104  explicit QwtPlotCanvas( QwtPlot* = NULL );
105  virtual ~QwtPlotCanvas();
106 
107  void setPaintAttribute( PaintAttribute, bool on = true );
108  bool testPaintAttribute( PaintAttribute ) const;
109 
110  const QPixmap* backingStore() const;
111  Q_INVOKABLE void invalidateBackingStore();
112 
113  virtual bool event( QEvent* ) QWT_OVERRIDE;
114 
115  Q_INVOKABLE QPainterPath borderPath( const QRect& ) const;
116 
117  public Q_SLOTS:
118  void replot();
119 
120  protected:
121  virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
122  virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
123 
124  virtual void drawBorder( QPainter* ) QWT_OVERRIDE;
125 
126  private:
127  class PrivateData;
128  PrivateData* m_data;
129 };
130 
131 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
132 
133 #endif
Base class for all type of plot canvases.
virtual void drawBorder(QPainter *)
Canvas of a QwtPlot.
QFlags< PaintAttribute > PaintAttributes
PaintAttribute
Paint attributes.
A 2-D plotting widget.
Definition: qwt_plot.h:79