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
00056 enum PaintAttribute
00057 {
00058 PaintCached = 1,
00059 PaintPacked = 2
00060 };
00061
00080 enum FocusIndicator
00081 {
00082 NoFocusIndicator,
00083 CanvasFocusIndicator,
00084 ItemFocusIndicator
00085 };
00086
00087 void setFocusIndicator(FocusIndicator);
00088 FocusIndicator focusIndicator() const;
00089
00090 void setPaintAttribute(PaintAttribute, bool on = true);
00091 bool testPaintAttribute(PaintAttribute) const;
00092
00093 QPixmap *paintCache();
00094 const QPixmap *paintCache() const;
00095 void invalidatePaintCache();
00096
00097 protected:
00098 explicit QwtPlotCanvas(QwtPlot *);
00099 virtual ~QwtPlotCanvas();
00100
00101 virtual void hideEvent(QHideEvent *);
00102
00103 virtual void paintEvent(QPaintEvent *);
00104
00105 virtual void drawContents(QPainter *);
00106 virtual void drawFocusIndicator(QPainter *);
00107
00108 void drawCanvas(QPainter *painter = NULL);
00109
00110 private:
00111 void setSystemBackground(bool);
00112
00113 class PrivateData;
00114 PrivateData *d_data;
00115 };
00116
00117 #endif