21 return ( d1 >= d2 ) || qFuzzyCompare( d1, d2 );
178 setPen( QPen( color, width, style ) );
284 const QRectF &canvasRect )
const 288 minorPen.setCapStyle( Qt::FlatCap );
290 painter->setPen( minorPen );
294 drawLines( painter, canvasRect, Qt::Vertical, xMap,
296 drawLines( painter, canvasRect, Qt::Vertical, xMap,
302 drawLines( painter, canvasRect, Qt::Horizontal, yMap,
304 drawLines( painter, canvasRect, Qt::Horizontal, yMap,
310 majorPen.setCapStyle( Qt::FlatCap );
312 painter->setPen( majorPen );
316 drawLines( painter, canvasRect, Qt::Vertical, xMap,
322 drawLines( painter, canvasRect, Qt::Horizontal, yMap,
328 Qt::Orientation orientation,
const QwtScaleMap &scaleMap,
329 const QList<double> &values )
const 331 const double x1 = canvasRect.left();
332 const double x2 = canvasRect.right() - 1.0;
333 const double y1 = canvasRect.top();
334 const double y2 = canvasRect.bottom() - 1.0;
338 for (
int i = 0;
i < values.count();
i++ )
342 value = qRound( value );
344 if ( orientation == Qt::Horizontal )
virtual void legendChanged()
void setMajorPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
virtual void updateScaleDiv(const QwtScaleDiv &xMap, const QwtScaleDiv &yMap)
static void drawLine(QPainter *, double x1, double y1, double x2, double y2)
Wrapper for QPainter::drawLine()
void setYDiv(const QwtScaleDiv &sy)
const QPen & minorPen() const
void enableXMin(bool tf)
Enable or disable minor vertical grid lines.
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const
Draw the grid.
A class representing a scale division.
void enableX(bool tf)
Enable or disable vertical grid lines.
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
virtual ~QwtPlotGrid()
Destructor.
A class representing a text.
void setZ(double z)
Set the z value.
void setMinorPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
void enableYMin(bool tf)
Enable or disable minor horizontal grid lines.
const QPen & majorPen() const
virtual void itemChanged()
QwtPlotGrid()
Enables major grid, disables minor grid.
static bool qwtFuzzyGreaterOrEqual(double d1, double d2)
const QwtScaleDiv & xScaleDiv() const
Base class for items on the plot canvas.
double transform(double s) const
void setItemInterest(ItemInterest, bool on=true)
QList< double > ticks(int tickType) const
void enableY(bool tf)
Enable or disable horizontal grid lines.
void setXDiv(const QwtScaleDiv &sx)
static bool roundingAlignment()
const QwtScaleDiv & yScaleDiv() const
void drawLines(QPainter *painter, const QRectF &, Qt::Orientation orientation, const QwtScaleMap &, const QList< double > &) const