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
00028 class QWT_EXPORT QwtPlotCanvas : public QFrame
00029 {
00030 Q_OBJECT
00031 friend class QwtPlot;
00032
00033 public:
00034
00052 enum PaintAttribute
00053 {
00054 PaintCached = 1,
00055 PaintPacked = 2
00056 };
00057
00076 enum FocusIndicator
00077 {
00078 NoFocusIndicator,
00079 CanvasFocusIndicator,
00080 ItemFocusIndicator
00081 };
00082
00083 void setFocusIndicator(FocusIndicator);
00084 FocusIndicator focusIndicator() const;
00085
00086 void setPaintAttribute(PaintAttribute, bool on = true);
00087 bool testPaintAttribute(PaintAttribute) const;
00088
00089 QPixmap *cache();
00090 const QPixmap *cache() const;
00091 void invalidateCache();
00092
00093 protected:
00094 explicit QwtPlotCanvas(QwtPlot *);
00095 virtual ~QwtPlotCanvas();
00096
00097 virtual void hideEvent(QHideEvent *);
00098
00099 virtual void paintEvent(QPaintEvent *);
00100
00101 virtual void drawContents(QPainter *);
00102 virtual void drawFocusIndicator(QPainter *);
00103
00104 void drawCanvas(QPainter *painter = NULL);
00105
00106 private:
00107 void setSystemBackground(bool);
00108
00109 class PrivateData;
00110 PrivateData *d_data;
00111 };
00112
00113 #endif