Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_grid.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_GRID_H
11#define QWT_PLOT_GRID_H
12
13#include "qwt_global.h"
14#include "qwt_plot_item.h"
15
16class QPainter;
17class QPen;
18class QwtScaleMap;
19class QwtScaleDiv;
20
33class QWT_EXPORT QwtPlotGrid : public QwtPlotItem
34{
35 public:
36 explicit QwtPlotGrid();
37 virtual ~QwtPlotGrid();
38
39 virtual int rtti() const QWT_OVERRIDE;
40
41 void enableX( bool );
42 bool xEnabled() const;
43
44 void enableY( bool );
45 bool yEnabled() const;
46
47 void enableXMin( bool );
48 bool xMinEnabled() const;
49
50 void enableYMin( bool );
51 bool yMinEnabled() const;
52
53 void setXDiv( const QwtScaleDiv& );
54 const QwtScaleDiv& xScaleDiv() const;
55
56 void setYDiv( const QwtScaleDiv& );
57 const QwtScaleDiv& yScaleDiv() const;
58
59 void setPen( const QColor&,
60 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
61
62 void setPen( const QPen& );
63
64 void setMajorPen( const QColor&,
65 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
66
67 void setMajorPen( const QPen& );
68 const QPen& majorPen() const;
69
70 void setMinorPen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
71 void setMinorPen( const QPen& );
72 const QPen& minorPen() const;
73
74 virtual void draw( QPainter*,
75 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
76 const QRectF& canvasRect ) const QWT_OVERRIDE;
77
78 virtual void updateScaleDiv(
79 const QwtScaleDiv& xScaleDiv, const QwtScaleDiv& yScaleDiv ) QWT_OVERRIDE;
80
81 private:
82 void drawLines( QPainter*, const QRectF&,
83 Qt::Orientation, const QwtScaleMap&,
84 const QList< double >& ) const;
85
86 class PrivateData;
87 PrivateData* m_data;
88};
89
90#endif
A class which draws a coordinate grid.
Base class for items on the plot canvas.
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
virtual int rtti() const
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &)
Update the item to changes of the axes scale division.
A class representing a scale division.
A scale map.