Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_abstract_canvas.h
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
16class QwtPlot;
17
21class QWT_EXPORT QwtPlotAbstractCanvas
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;
159 PrivateData* m_data;
160};
161
162Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotAbstractGLCanvas::PaintAttributes )
163
164#endif
Base class for all type of plot canvases.
FocusIndicator
Focus indicator The default setting is NoFocusIndicator.
@ NoFocusIndicator
Don't paint a focus indicator.
Base class of QwtPlotOpenGLCanvas and QwtPlotGLCanvas.
virtual void invalidateBackingStore()=0
Invalidate the internal backing store.
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
A 2-D plotting widget.
Definition qwt_plot.h:79