00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_CANVAS_H
00011 #define QWT_PLOT_CANVAS_H
00012
00013 #include "qwt_global.h"
00014 #include <qframe.h>
00015 #include <qpen.h>
00016
00017 class QwtPlot;
00018 class QPixmap;
00019
00024 class QWT_EXPORT QwtPlotCanvas : public QFrame
00025 {
00026 Q_OBJECT
00027
00028 public:
00029
00051 enum PaintAttribute
00052 {
00053 PaintCached = 1,
00054 PaintPacked = 2
00055 };
00056
00075 enum FocusIndicator
00076 {
00077 NoFocusIndicator,
00078 CanvasFocusIndicator,
00079 ItemFocusIndicator
00080 };
00081
00082 explicit QwtPlotCanvas( QwtPlot * );
00083 virtual ~QwtPlotCanvas();
00084
00085 QwtPlot *plot();
00086 const QwtPlot *plot() const;
00087
00088 void setFocusIndicator( FocusIndicator );
00089 FocusIndicator focusIndicator() const;
00090
00091 void setPaintAttribute( PaintAttribute, bool on = true );
00092 bool testPaintAttribute( PaintAttribute ) const;
00093
00094 QPixmap *paintCache();
00095 const QPixmap *paintCache() const;
00096 void invalidatePaintCache();
00097
00098 void replot();
00099
00100 protected:
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