qwt_plot_abstract_canvas.h
Go to the documentation of this file.
1 /******************************************************************************
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 
22 {
23  public:
31  {
34 
40 
46  ItemFocusIndicator
47  };
48 
49  explicit QwtPlotAbstractCanvas( QWidget* canvasWidget );
50  virtual ~QwtPlotAbstractCanvas();
51 
52  QwtPlot* plot();
53  const QwtPlot* plot() const;
54 
55  void setFocusIndicator( FocusIndicator );
56  FocusIndicator focusIndicator() const;
57 
58  void setBorderRadius( double );
59  double borderRadius() const;
60 
61  protected:
62  QWidget* canvasWidget();
63  const QWidget* canvasWidget() const;
64 
65  virtual void drawFocusIndicator( QPainter* );
66  virtual void drawBorder( QPainter* );
67  virtual void drawBackground( QPainter* );
68 
69  void fillBackground( QPainter* );
70  void drawCanvas( QPainter* );
71  void drawStyled( QPainter*, bool );
72  void drawUnstyled( QPainter* );
73 
74  QPainterPath canvasBorderPath( const QRect& rect ) const;
75  void updateStyleSheetInfo();
76 
77  private:
78  Q_DISABLE_COPY(QwtPlotAbstractCanvas)
79 
80  class PrivateData;
81  PrivateData* m_data;
82 };
83 
88 {
89  public:
98  {
110  BackingStore = 1,
111 
118  ImmediatePaint = 8,
119  };
120 
122  Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
123 
124  explicit QwtPlotAbstractGLCanvas( QWidget* canvasWidget );
125  virtual ~QwtPlotAbstractGLCanvas();
126 
127  void setPaintAttribute( PaintAttribute, bool on = true );
128  bool testPaintAttribute( PaintAttribute ) const;
129 
130  void setFrameStyle( int style );
131  int frameStyle() const;
132 
133  void setFrameShadow( QFrame::Shadow );
134  QFrame::Shadow frameShadow() const;
135 
136  void setFrameShape( QFrame::Shape );
137  QFrame::Shape frameShape() const;
138 
139  void setLineWidth( int );
140  int lineWidth() const;
141 
142  void setMidLineWidth( int );
143  int midLineWidth() const;
144 
145  int frameWidth() const;
146  QRect frameRect() const;
147 
149  virtual void invalidateBackingStore() = 0;
150 
151  protected:
152  void replot();
153  void draw( QPainter* );
154 
155  private:
156  virtual void clearBackingStore() = 0;
157 
158  class PrivateData;
160 };
161 
162 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotAbstractGLCanvas::PaintAttributes )
163 
164 #endif
QwtPlotAbstractGLCanvas::PaintAttribute
PaintAttribute
Paint attributes.
Definition: qwt_plot_abstract_canvas.h:97
QwtPlotAbstractGLCanvas
Base class of QwtPlotOpenGLCanvas and QwtPlotGLCanvas.
Definition: qwt_plot_abstract_canvas.h:87
QwtPlotAbstractCanvas::CanvasFocusIndicator
@ CanvasFocusIndicator
Definition: qwt_plot_abstract_canvas.h:39
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:78
QwtPlotAbstractCanvas::NoFocusIndicator
@ NoFocusIndicator
Don't paint a focus indicator.
Definition: qwt_plot_abstract_canvas.h:33
qwt_global.h
QwtPlotAbstractGLCanvas::PrivateData
Definition: qwt_plot_abstract_canvas.cpp:883
QwtPlotAbstractCanvas::PrivateData
Definition: qwt_plot_abstract_canvas.cpp:500
QwtPlotAbstractGLCanvas::m_data
PrivateData * m_data
Definition: qwt_plot_abstract_canvas.h:158
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
QwtPlotAbstractCanvas::FocusIndicator
FocusIndicator
Focus indicator The default setting is NoFocusIndicator.
Definition: qwt_plot_abstract_canvas.h:30
QwtPlotAbstractCanvas
Base class for all type of plot canvases.
Definition: qwt_plot_abstract_canvas.h:21


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:24