qwt_plot_abstract_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_ABSTRACT_CANVAS_H
11 #define QWT_PLOT_ABSTRACT_CANVAS_H
12 
13 #include "qwt_global.h"
14 #include <qframe.h>
15 
16 class QwtPlot;
17 
19 {
20 public:
28  {
31 
37 
43  ItemFocusIndicator
44  };
45 
46  explicit QwtPlotAbstractCanvas( QWidget *canvasWidget );
47  virtual ~QwtPlotAbstractCanvas();
48 
49  QwtPlot *plot();
50  const QwtPlot *plot() const;
51 
52  void setFocusIndicator( FocusIndicator );
53  FocusIndicator focusIndicator() const;
54 
55  void setBorderRadius( double );
56  double borderRadius() const;
57 
58 protected:
59  QWidget* canvasWidget();
60  const QWidget* canvasWidget() const;
61 
62  virtual void drawFocusIndicator( QPainter * );
63  virtual void drawBorder( QPainter * );
64  virtual void drawBackground( QPainter * );
65 
66  void fillBackground( QPainter * );
67  void drawCanvas( QPainter * );
68  void drawStyled( QPainter *, bool );
69  void drawUnstyled( QPainter * );
70 
71  QPainterPath borderPath2( const QRect &rect ) const;
72  void updateStyleSheetInfo();
73 
74 private:
75  Q_DISABLE_COPY(QwtPlotAbstractCanvas)
76 
77  class PrivateData;
78  PrivateData *d_data;
79 };
80 
82 {
83 public:
92  {
104  BackingStore = 1,
105 
112  ImmediatePaint = 8,
113  };
114 
116  typedef QFlags<PaintAttribute> PaintAttributes;
117 
118  explicit QwtPlotAbstractGLCanvas( QWidget *canvasWidget );
119  virtual ~QwtPlotAbstractGLCanvas();
120 
121  void setPaintAttribute( PaintAttribute, bool on = true );
122  bool testPaintAttribute( PaintAttribute ) const;
123 
124  void setFrameStyle( int style );
125  int frameStyle() const;
126 
127  void setFrameShadow( QFrame::Shadow );
128  QFrame::Shadow frameShadow() const;
129 
130  void setFrameShape( QFrame::Shape );
131  QFrame::Shape frameShape() const;
132 
133  void setLineWidth( int );
134  int lineWidth() const;
135 
136  void setMidLineWidth( int );
137  int midLineWidth() const;
138 
139  int frameWidth() const;
140  QRect frameRect() const;
141 
142  virtual void invalidateBackingStore() = 0;
143 
144 protected:
145  void replot();
146  void draw( QPainter * );
147 
148 private:
149  virtual void clearBackingStore() = 0;
150 
151  class PrivateData;
152  PrivateData *d_data;
153 };
154 
155 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotAbstractGLCanvas::PaintAttributes )
156 
157 #endif
Don&#39;t paint a focus indicator.
#define QWT_EXPORT
Definition: qwt_global.h:38
A 2-D plotting widget.
Definition: qwt_plot.h:75
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
FocusIndicator
Focus indicator The default setting is NoFocusIndicator.


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