Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef QWT_PLOT_CANVAS_H
00013 #define QWT_PLOT_CANVAS_H
00014
00015 #include <qframe.h>
00016 #include <qpen.h>
00017 #include "qwt_global.h"
00018
00019 class QwtPlot;
00020 class QPixmap;
00021
00026 class QWT_EXPORT QwtPlotCanvas : public QFrame
00027 {
00028 Q_OBJECT
00029
00030 public:
00031
00053 enum PaintAttribute
00054 {
00055 PaintCached = 1,
00056 PaintPacked = 2
00057 };
00058
00077 enum FocusIndicator
00078 {
00079 NoFocusIndicator,
00080 CanvasFocusIndicator,
00081 ItemFocusIndicator
00082 };
00083
00084 explicit QwtPlotCanvas(QwtPlot *);
00085 virtual ~QwtPlotCanvas();
00086
00087 QwtPlot *plot();
00088 const QwtPlot *plot() const;
00089
00090 void setFocusIndicator(FocusIndicator);
00091 FocusIndicator focusIndicator() const;
00092
00093 void setPaintAttribute(PaintAttribute, bool on = true);
00094 bool testPaintAttribute(PaintAttribute) const;
00095
00096 QPixmap *paintCache();
00097 const QPixmap *paintCache() const;
00098 void invalidatePaintCache();
00099
00100 void replot();
00101
00102 protected:
00103 virtual void hideEvent(QHideEvent *);
00104
00105 virtual void paintEvent(QPaintEvent *);
00106
00107 virtual void drawContents(QPainter *);
00108 virtual void drawFocusIndicator(QPainter *);
00109
00110 void drawCanvas(QPainter *painter = NULL);
00111
00112 private:
00113 void setSystemBackground(bool);
00114
00115 class PrivateData;
00116 PrivateData *d_data;
00117 };
00118
00119 #endif