Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_seriesitem.cpp
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#include "qwt_plot_seriesitem.h"
11#include "qwt_scale_div.h"
12#include "qwt_text.h"
13
14class QwtPlotSeriesItem::PrivateData
15{
16 public:
17 PrivateData()
18 : orientation( Qt::Vertical )
19 {
20 }
21
22 Qt::Orientation orientation;
23};
24
30 : QwtPlotItem( title )
31{
32 m_data = new PrivateData();
34}
35
41 : QwtPlotItem( QwtText( title ) )
42{
43 m_data = new PrivateData();
45}
46
49{
50 delete m_data;
51}
52
62void QwtPlotSeriesItem::setOrientation( Qt::Orientation orientation )
63{
64 if ( m_data->orientation != orientation )
65 {
66 m_data->orientation = orientation;
67
70 }
71}
72
77Qt::Orientation QwtPlotSeriesItem::orientation() const
78{
79 return m_data->orientation;
80}
81
90void QwtPlotSeriesItem::draw( QPainter* painter,
91 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
92 const QRectF& canvasRect ) const
93{
94 drawSeries( painter, xMap, yMap, canvasRect, 0, -1 );
95}
96
98{
99 return dataRect();
100}
101
103 const QwtScaleDiv& xScaleDiv, const QwtScaleDiv& yScaleDiv )
104{
105 const QRectF rect = QRectF(
106 xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
107 xScaleDiv.range(), yScaleDiv.range() );
108
109 setRectOfInterest( rect );
110}
111
virtual QRectF dataRect() const =0
virtual void setRectOfInterest(const QRectF &)=0
Base class for items on the plot canvas.
virtual void legendChanged()
void setItemInterest(ItemInterest, bool on=true)
virtual void itemChanged()
Qt::Orientation orientation() const
virtual void dataChanged() override
dataChanged() indicates, that the series has been changed.
void setOrientation(Qt::Orientation)
virtual ~QwtPlotSeriesItem()
Destructor.
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &) override
Update the item to changes of the axes scale division.
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
Draw the complete series.
QwtPlotSeriesItem(const QString &title=QString())
virtual QRectF boundingRect() const override
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
A class representing a scale division.
double lowerBound() const
double range() const
A scale map.
A class representing a text.
Definition qwt_text.h:52