Qwt Polar User's Guide  0.1.0
qwt_polar_canvas.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * QwtPolar Widget Library
3  * Copyright (C) 2008 Uwe Rathmann
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the Qwt License, Version 1.0
7  *****************************************************************************/
8 
9 #ifndef QWT_POLAR_CANVAS_H
10 #define QWT_POLAR_CANVAS_H 1
11 
12 #include <qframe.h>
13 #include "qwt_polar_global.h"
14 #include "qwt_double_rect.h"
15 
16 class QPainter;
17 class QwtPolarPlot;
18 
27 class QWT_POLAR_EXPORT QwtPolarCanvas: public QFrame
28 {
29  Q_OBJECT
30 
31 public:
45  {
46  PaintCached = 1
47  };
48 
49  explicit QwtPolarCanvas(QwtPolarPlot *);
50  virtual ~QwtPolarCanvas();
51 
52  QwtPolarPlot *plot();
53  const QwtPolarPlot *plot() const;
54 
55  void setPaintAttribute(PaintAttribute, bool on = true);
56  bool testPaintAttribute(PaintAttribute) const;
57 
58  QPixmap *paintCache();
59  const QPixmap *paintCache() const;
60  void invalidatePaintCache();
61 
62 protected:
63  virtual void paintEvent(QPaintEvent *);
64  virtual void resizeEvent(QResizeEvent *);
65 
66  virtual void drawContents(QPainter *);
67 
68  void drawCanvas(QPainter *, const QwtDoubleRect &);
69 
70  class PrivateData;
71  PrivateData *d_data;
72 };
73 
74 #endif