qwt_plot_canvas.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_PLOT_CANVAS_H
11 #define QWT_PLOT_CANVAS_H
12 
13 #include "qwt_global.h"
15 
16 #include <qframe.h>
17 
18 class QwtPlot;
19 class QPixmap;
20 class QPainterPath;
21 
29 class QWT_EXPORT QwtPlotCanvas : public QFrame, public QwtPlotAbstractCanvas
30 {
31  Q_OBJECT
32 
33  Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
34 
35 public:
36 
45  {
57  BackingStore = 1,
58 
74  Opaque = 2,
75 
91  HackStyledBackground = 4,
92 
99  ImmediatePaint = 8
100  };
101 
103  typedef QFlags<PaintAttribute> PaintAttributes;
104 
105  explicit QwtPlotCanvas( QwtPlot * = NULL );
106  virtual ~QwtPlotCanvas();
107 
108  void setPaintAttribute( PaintAttribute, bool on = true );
109  bool testPaintAttribute( PaintAttribute ) const;
110 
111  const QPixmap *backingStore() const;
112  Q_INVOKABLE void invalidateBackingStore();
113 
114  virtual bool event( QEvent * ) QWT_OVERRIDE;
115 
116  Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
117 
118 public Q_SLOTS:
119  void replot();
120 
121 protected:
122  virtual void paintEvent( QPaintEvent * ) QWT_OVERRIDE;
123  virtual void resizeEvent( QResizeEvent * ) QWT_OVERRIDE;
124 
125  virtual void drawBorder( QPainter * ) QWT_OVERRIDE;
126 
127 private:
128  class PrivateData;
129  PrivateData *d_data;
130 };
131 
132 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
133 
134 #endif
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
#define QWT_EXPORT
Definition: qwt_global.h:38
Canvas of a QwtPlot.
A 2-D plotting widget.
Definition: qwt_plot.h:75
PaintAttribute
Paint attributes.
#define QWT_OVERRIDE
Definition: qwt_global.h:53


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10