Go to the documentation of this file.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 "qwt_plot_abstract_canvas.h"
00015 #include <qframe.h>
00016 #include <qpainterpath.h>
00017
00018 class QwtPlot;
00019 class QPixmap;
00020
00028 class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
00029 {
00030 Q_OBJECT
00031
00032 Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
00033
00034 public:
00035
00043 enum PaintAttribute
00044 {
00056 BackingStore = 1,
00057
00073 Opaque = 2,
00074
00090 HackStyledBackground = 4,
00091
00098 ImmediatePaint = 8,
00099
00122 OpenGLBuffer = 16
00123 };
00124
00126 typedef QFlags<PaintAttribute> PaintAttributes;
00127
00128 explicit QwtPlotCanvas( QwtPlot * = NULL );
00129 virtual ~QwtPlotCanvas();
00130
00131 void setPaintAttribute( PaintAttribute, bool on = true );
00132 bool testPaintAttribute( PaintAttribute ) const;
00133
00134 const QPixmap *backingStore() const;
00135 Q_INVOKABLE void invalidateBackingStore();
00136
00137 virtual bool event( QEvent * );
00138
00139 Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
00140
00141 public Q_SLOTS:
00142 void replot();
00143
00144 protected:
00145 virtual void paintEvent( QPaintEvent * );
00146 virtual void resizeEvent( QResizeEvent * );
00147
00148 virtual void drawBorder( QPainter * );
00149
00150 private:
00151 QImage toImageFBO( const QSize &size );
00152
00153 class PrivateData;
00154 PrivateData *d_data;
00155 };
00156
00157 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
00158
00159 #endif