00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_CANVAS_H
00011 #define QWT_PLOT_CANVAS_H
00012
00013 #include <qframe.h>
00014 #include <qpen.h>
00015 #include "qwt_global.h"
00016 #include "qwt.h"
00017
00024 class QWT_EXPORT QwtPlotCanvas : public QFrame
00025 {
00026 Q_OBJECT
00027 friend class QwtPlot;
00028 public:
00029 void enableOutline(bool tf);
00030 bool outlineEnabled() const;
00031
00032 void setOutlinePen(const QPen &p);
00033 const QPen& outlinePen() const;
00034
00035 void setOutlineStyle(Qwt::Shape os);
00036 Qwt::Shape outlineStyle() const;
00037
00038 signals:
00044 void mousePressed(const QMouseEvent &e);
00045
00051 void mouseReleased(const QMouseEvent &e);
00052
00058 void mouseMoved(const QMouseEvent &e);
00059
00060 protected:
00061 QwtPlotCanvas(QwtPlot *);
00062
00063 virtual void frameChanged();
00064 virtual void drawContents(QPainter *);
00065
00066 virtual void mousePressEvent(QMouseEvent *e);
00067 virtual void mouseReleaseEvent(QMouseEvent *e);
00068 virtual void mouseMoveEvent(QMouseEvent *e);
00069
00070 private:
00071 void drawOutline(QPainter &p);
00072
00073 bool d_outlineEnabled;
00074 bool d_outlineActive;
00075 bool d_mousePressed;
00076 Qwt::Shape d_outline;
00077
00078 QPen d_pen;
00079 QPoint d_entryPoint;
00080 QPoint d_lastPoint;
00081 };
00082
00083 #endif