From 7594bc4927de746e46fa4c300b464d3c605e6db9 2012-02-27 11:31:33 From: Michal Klocek Date: 2012-02-27 11:31:33 Subject: [PATCH] Rename QLineChartSeries to QLineSeries --- diff --git a/charts.pro b/charts.pro index a597146..0d86d66 100644 --- a/charts.pro +++ b/charts.pro @@ -13,8 +13,8 @@ integrated_build:{ CONFIG += ordered QMAKE_CXXFLAGS += -g -Wall -unix:QMAKE_DISTCLEAN += -r build bin doc/html -win32:QMAKE_DISTCLEAN += /Q /s build bin doc\\html +unix:QMAKE_DISTCLEAN += -r build bin include lib doc/html +win32:QMAKE_DISTCLEAN += /Q /s build bin include lib doc\\html # install feature file feature.path = $$[QT_INSTALL_DATA]/mkspecs/features diff --git a/example/axischart/main.cpp b/example/axischart/main.cpp index 602161e..26b4b65 100644 --- a/example/axischart/main.cpp +++ b/example/axischart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -16,11 +16,11 @@ int main(int argc, char *argv[]) QMainWindow window; - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); diff --git a/example/chartview/main.cpp b/example/chartview/main.cpp index afe22b1..6152748 100644 --- a/example/chartview/main.cpp +++ b/example/chartview/main.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) chartView->setRenderHint(QPainter::Antialiasing); chartView->setChartTitle("Simple Line Chart"); // Add series to the chart - QLineChartSeries *line = new QLineChartSeries(); + QLineSeries *line = new QLineSeries(); line->add(0.0, 0.8); line->add(1.1, 1.1); line->add(2.0, 2.5); diff --git a/example/colorlinechart/main.cpp b/example/colorlinechart/main.cpp index f26b674..ae123b6 100644 --- a/example/colorlinechart/main.cpp +++ b/example/colorlinechart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -15,11 +15,11 @@ int main(int argc, char *argv[]) QMainWindow window; - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); diff --git a/example/dynamiclinechart/main.cpp b/example/dynamiclinechart/main.cpp index a968731..33c2dd7 100644 --- a/example/dynamiclinechart/main.cpp +++ b/example/dynamiclinechart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include "wavegenerator.h" @@ -13,11 +13,11 @@ int main(int argc, char *argv[]) QMainWindow window; - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); diff --git a/example/dynamiclinechart/wavegenerator.h b/example/dynamiclinechart/wavegenerator.h index d1e3d01..1bfcdb5 100644 --- a/example/dynamiclinechart/wavegenerator.h +++ b/example/dynamiclinechart/wavegenerator.h @@ -2,7 +2,7 @@ #include #include #include -#include +#include QTCOMMERCIALCHART_USE_NAMESPACE @@ -14,7 +14,7 @@ class WaveGenerator: public QObject Q_OBJECT public: - WaveGenerator(QLineChartSeries* series1, QLineChartSeries* series2) : + WaveGenerator(QLineSeries* series1, QLineSeries* series2) : m_series1(series1), m_series2(series2), m_wave(0), @@ -52,8 +52,8 @@ public slots: } private: - QLineChartSeries* m_series1; - QLineChartSeries* m_series2; + QLineSeries* m_series1; + QLineSeries* m_series2; int m_wave; qreal m_step; QTimer m_timer; diff --git a/example/linechart/main.cpp b/example/linechart/main.cpp index 30e52c4..992a87a 100644 --- a/example/linechart/main.cpp +++ b/example/linechart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -15,12 +15,12 @@ int main(int argc, char *argv[]) //![1] - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); diff --git a/example/presenterchart/chartview.cpp b/example/presenterchart/chartview.cpp index 877ea3f..1953a92 100644 --- a/example/presenterchart/chartview.cpp +++ b/example/presenterchart/chartview.cpp @@ -1,5 +1,5 @@ #include "chartview.h" -#include +#include #include ChartView::ChartView(QWidget* parent):QChartView(parent), @@ -11,15 +11,15 @@ m_index(0) QTime now = QTime::currentTime(); qsrand((uint)now.msec()); - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); - QLineChartSeries* series2 = new QLineChartSeries(); + QLineSeries* series2 = new QLineSeries(); QPen green(Qt::green); green.setWidth(3); series2->setPen(green); diff --git a/example/zoomlinechart/main.cpp b/example/zoomlinechart/main.cpp index a34cb6c..0e307f8 100644 --- a/example/zoomlinechart/main.cpp +++ b/example/zoomlinechart/main.cpp @@ -1,7 +1,7 @@ #include "chartwidget.h" #include #include -#include +#include #include QTCOMMERCIALCHART_USE_NAMESPACE @@ -14,11 +14,11 @@ int main(int argc, char *argv[]) QMainWindow window; - QLineChartSeries* series0 = new QLineChartSeries(); + QLineSeries* series0 = new QLineSeries(); QPen blue(Qt::blue); blue.setWidth(3); series0->setPen(blue); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); QPen red(Qt::red); red.setWidth(3); series1->setPen(red); diff --git a/qmlplugin/declarativelineseries.cpp b/qmlplugin/declarativelineseries.cpp index 627c3c4..558aa23 100644 --- a/qmlplugin/declarativelineseries.cpp +++ b/qmlplugin/declarativelineseries.cpp @@ -1,7 +1,7 @@ #include "declarativelineseries.h" #include "declarativechart.h" #include "qchart.h" -#include "qlinechartseries.h" +#include "qlineseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -23,7 +23,7 @@ void DeclarativeLineSeries::setParentForSeries() qDebug() << "creating line series for chart: " << chart; Q_ASSERT(chart); - m_series = new QLineChartSeries(); + m_series = new QLineSeries(); Q_ASSERT(m_series); for (int i(0); i < m_data.count(); i++) { ScatterElement *element = m_data.at(i); diff --git a/qmlplugin/declarativelineseries.h b/qmlplugin/declarativelineseries.h index 9819453..92bb1b1 100644 --- a/qmlplugin/declarativelineseries.h +++ b/qmlplugin/declarativelineseries.h @@ -8,7 +8,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QChart; -class QLineChartSeries; +class QLineSeries; class DeclarativeLineSeries : public QDeclarativeItem { @@ -30,7 +30,7 @@ private slots: private: QChart *m_chart; - QLineChartSeries *m_series; + QLineSeries *m_series; QList m_data; }; diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index a15aba8..d1b7d59 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -1,7 +1,7 @@ #include "chartdataset_p.h" #include "qchartaxis.h" //series -#include "qlinechartseries.h" +#include "qlineseries.h" #include "qbarseries.h" #include "qstackedbarseries.h" #include "qpercentbarseries.h" @@ -57,7 +57,7 @@ void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) { case QChartSeries::SeriesTypeLine: { - QLineChartSeries* xyseries = static_cast(series); + QLineSeries* xyseries = static_cast(series); for (int i = 0; i < xyseries->count(); i++) { diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index 2f47352..4bcddac 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -7,7 +7,7 @@ #include "qbarseries.h" #include "qstackedbarseries.h" #include "qpercentbarseries.h" -#include "qlinechartseries.h" +#include "qlineseries.h" #include "qpieseries.h" #include "qscatterseries.h" //items @@ -109,7 +109,7 @@ void ChartPresenter::handleSeriesAdded(QChartSeries* series) switch(series->type()) { case QChartSeries::SeriesTypeLine: { - QLineChartSeries* lineSeries = static_cast(series); + QLineSeries* lineSeries = static_cast(series); LineChartItem* item; if(m_options.testFlag(QChart::SeriesAnimations)){ item = new LineChartAnimationItem(this,lineSeries,m_chart); diff --git a/src/charttheme.cpp b/src/charttheme.cpp index 51118ce..f9bc997 100644 --- a/src/charttheme.cpp +++ b/src/charttheme.cpp @@ -8,7 +8,7 @@ #include "qbarseries.h" #include "qstackedbarseries.h" #include "qpercentbarseries.h" -#include "qlinechartseries.h" +#include "qlineseries.h" #include "qscatterseries.h" #include "qpieseries.h" #include "qpieslice.h" @@ -85,7 +85,7 @@ void ChartTheme::decorate(ChartItem* item, QChartSeries* series,int count) switch(series->type()) { case QChartSeries::SeriesTypeLine: { - QLineChartSeries* s = static_cast(series); + QLineSeries* s = static_cast(series); LineChartItem* i = static_cast(item); decorate(i,s,count); break; @@ -129,7 +129,7 @@ void ChartTheme::decorate(ChartItem* item, QChartSeries* series,int count) } -void ChartTheme::decorate(LineChartItem* item, QLineChartSeries* series,int count) +void ChartTheme::decorate(LineChartItem* item, QLineSeries* series,int count) { QPen pen; if(pen != series->pen()){ diff --git a/src/charttheme_p.h b/src/charttheme_p.h index 4320cf6..e488a03 100644 --- a/src/charttheme_p.h +++ b/src/charttheme_p.h @@ -10,7 +10,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartItem; class QChartSeries; class LineChartItem; -class QLineChartSeries; +class QLineSeries; class BarPresenter; class QBarSeries; class StackedBarPresenter; @@ -31,10 +31,10 @@ public: QChart::ChartTheme id() const {return m_id;} void decorate(QChart* chart); void decorate(ChartItem* item, QChartSeries* series,int count); - void decorate(LineChartItem* item, QLineChartSeries*, int count); void decorate(BarPresenter* item, QBarSeries* series,int count); void decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count); void decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count); + void decorate(LineChartItem* item, QLineSeries*, int count); void decorate(ScatterPresenter* presenter, QScatterSeries* series, int count); void decorate(PiePresenter* item, QPieSeries* series, int count); void decorate(QChartAxis* axis,AxisItem* item); diff --git a/src/linechart/linechart.pri b/src/linechart/linechart.pri index 865dcd1..a3332b7 100644 --- a/src/linechart/linechart.pri +++ b/src/linechart/linechart.pri @@ -4,11 +4,11 @@ DEPENDPATH += $$PWD SOURCES += \ $$PWD/linechartanimationitem.cpp \ $$PWD/linechartitem.cpp \ - $$PWD/qlinechartseries.cpp + $$PWD/qlineseries.cpp PRIVATE_HEADERS += \ $$PWD/linechartitem_p.h \ $$PWD/linechartanimationitem_p.h PUBLIC_HEADERS += \ - $$PWD/qlinechartseries.h \ No newline at end of file + $$PWD/qlineseries.h \ No newline at end of file diff --git a/src/linechart/linechartanimationitem.cpp b/src/linechart/linechartanimationitem.cpp index 75ac2b8..0a07e80 100644 --- a/src/linechart/linechartanimationitem.cpp +++ b/src/linechart/linechartanimationitem.cpp @@ -7,7 +7,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE const static int duration = 500; -LineChartAnimationItem::LineChartAnimationItem(ChartPresenter* presenter, QLineChartSeries* series,QGraphicsItem *parent): +LineChartAnimationItem::LineChartAnimationItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent): LineChartItem(presenter,series,parent) { diff --git a/src/linechart/linechartanimationitem_p.h b/src/linechart/linechartanimationitem_p.h index 2ac6851..163df48 100644 --- a/src/linechart/linechartanimationitem_p.h +++ b/src/linechart/linechartanimationitem_p.h @@ -14,7 +14,7 @@ class LineChartAnimationItem : public LineChartItem { Q_PROPERTY(int a_addPoints READ ar_addPoints WRITE aw_addPoints); // Q_PROPERTY(QPointF a_setPoint READ ar_setPoint WRITE aw_setPoint); public: - LineChartAnimationItem(ChartPresenter* presenter, QLineChartSeries *series, QGraphicsItem *parent = 0); + LineChartAnimationItem(ChartPresenter* presenter, QLineSeries *series, QGraphicsItem *parent = 0); virtual ~LineChartAnimationItem(); void addPoints(const QVector& points); diff --git a/src/linechart/linechartitem.cpp b/src/linechart/linechartitem.cpp index 25d9e2c..fbe5ef3 100644 --- a/src/linechart/linechartitem.cpp +++ b/src/linechart/linechartitem.cpp @@ -1,5 +1,5 @@ #include "linechartitem_p.h" -#include "qlinechartseries.h" +#include "qlineseries.h" #include "chartpresenter_p.h" #include @@ -8,7 +8,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE //TODO: optimazie : remove points which are not visible -LineChartItem::LineChartItem(ChartPresenter* presenter, QLineChartSeries* series,QGraphicsItem *parent):ChartItem(parent), +LineChartItem::LineChartItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent):ChartItem(parent), m_presenter(presenter), m_series(series), m_dirtyData(false), @@ -111,7 +111,7 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt painter->restore(); } -void LineChartItem::calculatePoint(QPointF& point, int index, const QLineChartSeries* series,const QSizeF& size, const Domain& domain) const +void LineChartItem::calculatePoint(QPointF& point, int index, const QLineSeries* series,const QSizeF& size, const Domain& domain) const { const qreal deltaX = size.width()/domain.spanX(); const qreal deltaY = size.height()/domain.spanY(); @@ -122,7 +122,7 @@ void LineChartItem::calculatePoint(QPointF& point, int index, const QLineChartSe } -void LineChartItem::calculatePoints(QVector& points, QHash& hash,const QLineChartSeries* series,const QSizeF& size, const Domain& domain) const +void LineChartItem::calculatePoints(QVector& points, QHash& hash,const QLineSeries* series,const QSizeF& size, const Domain& domain) const { const qreal deltaX = size.width()/domain.spanX(); const qreal deltaY = size.height()/domain.spanY(); diff --git a/src/linechart/linechartitem_p.h b/src/linechart/linechartitem_p.h index fcf3eec..68ff1c9 100644 --- a/src/linechart/linechartitem_p.h +++ b/src/linechart/linechartitem_p.h @@ -8,14 +8,14 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartPresenter; -class QLineChartSeries; +class QLineSeries; class LineChartAnimationItem; class LineChartItem : public QObject , public ChartItem { Q_OBJECT public: - LineChartItem(ChartPresenter* presenter, QLineChartSeries* series,QGraphicsItem *parent = 0); + LineChartItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent = 0); ~ LineChartItem(){}; //from QGraphicsItem @@ -43,8 +43,8 @@ protected: virtual void updateData(); virtual void updateDomain(); //refactor - void calculatePoint(QPointF& point, int index, const QLineChartSeries* series,const QSizeF& size, const Domain& domain) const; - void calculatePoints(QVector& points,QHash& hash,const QLineChartSeries* series, const QSizeF& size, const Domain& domain) const; + void calculatePoint(QPointF& point, int index, const QLineSeries* series,const QSizeF& size, const Domain& domain) const; + void calculatePoints(QVector& points,QHash& hash,const QLineSeries* series, const QSizeF& size, const Domain& domain) const; protected slots: void handleModelChanged(int index); @@ -61,7 +61,7 @@ private: QList m_points; QVector m_data; QHash m_hash; - QLineChartSeries* m_series; + QLineSeries* m_series; QPen m_pen; bool m_dirtyData; bool m_dirtyGeometry; diff --git a/src/linechart/qlinechartseries.cpp b/src/linechart/qlineseries.cpp similarity index 89% rename from src/linechart/qlinechartseries.cpp rename to src/linechart/qlineseries.cpp index 1db9b92..876fa67 100644 --- a/src/linechart/qlinechartseries.cpp +++ b/src/linechart/qlineseries.cpp @@ -1,4 +1,4 @@ -#include "qlinechartseries.h" +#include "qlineseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -55,7 +55,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Constructs empty series object which is a child of \a parent. When series object is added to QChartView or QChart instance ownerships is transfered. */ -QLineChartSeries::QLineChartSeries(QObject* parent):QChartSeries(parent), +QLineSeries::QLineSeries(QObject* parent):QChartSeries(parent), m_pointsVisible(false) { } @@ -63,14 +63,14 @@ m_pointsVisible(false) Destroys the object. Series added to QChartView or QChart instances are owned by those, and are deleted when mentioned object are destroyed. */ -QLineChartSeries::~QLineChartSeries() +QLineSeries::~QLineSeries() { } /*! Adds data point \a x \a y to the series. Points are connected with lines on the chart. */ -void QLineChartSeries::add(qreal x,qreal y) +void QLineSeries::add(qreal x,qreal y) { m_x< #include #include -#include +#include #include #include @@ -10,7 +10,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE Q_DECLARE_METATYPE(Domain) Q_DECLARE_METATYPE(QChartAxis*) Q_DECLARE_METATYPE(QChartSeries*) -Q_DECLARE_METATYPE(QLineChartSeries*) +Q_DECLARE_METATYPE(QLineSeries*) class tst_ChartDataSet: public QObject { Q_OBJECT @@ -99,7 +99,7 @@ void tst_ChartDataSet::addDomain() ChartDataSet dataSet; Domain domain1(0, 1000, 0, 1000); - QLineChartSeries series; + QLineSeries series; series.add(0, 0); series.add(1000, 1000); @@ -173,7 +173,7 @@ void tst_ChartDataSet::addSeries() for (int i = 0; i < seriesCount; i++) { QChartAxis* axisY = 0; - QLineChartSeries* series = new QLineChartSeries(); + QLineSeries* series = new QLineSeries(); if (iterator != axisList.end()) { axisY = *iterator; iterator++; @@ -218,10 +218,10 @@ void tst_ChartDataSet::axisY() QVERIFY2(defaultAxisY, "Missing axisY."); - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); dataSet.addSeries(series1); - QLineChartSeries* series2 = new QLineChartSeries(); + QLineSeries* series2 = new QLineSeries(); dataSet.addSeries(series2, axisY); QVERIFY(dataSet.axisY(series1) == defaultAxisY); @@ -244,7 +244,7 @@ void tst_ChartDataSet::clearDomains() QFETCH(int, indexCount); Domain domain1(0, 100, 0, 100); - QLineChartSeries* series = new QLineChartSeries(); + QLineSeries* series = new QLineSeries(); series->add(0, 0); series->add(100, 100); @@ -315,13 +315,13 @@ void tst_ChartDataSet::domain() QFETCH(Domain, domain); ChartDataSet dataSet; - QLineChartSeries* series1 = new QLineChartSeries(); + QLineSeries* series1 = new QLineSeries(); series1->add(domain1.m_minX, domain1.m_minY); series1->add(domain1.m_maxX, domain1.m_maxY); - QLineChartSeries* series2 = new QLineChartSeries(); + QLineSeries* series2 = new QLineSeries(); series2->add(domain2.m_minX, domain2.m_minY); series2->add(domain2.m_maxX, domain2.m_maxY); - QLineChartSeries* series3 = new QLineChartSeries(); + QLineSeries* series3 = new QLineSeries(); series3->add(domain3.m_minX, domain3.m_minY); series3->add(domain3.m_maxX, domain3.m_maxY); @@ -370,7 +370,7 @@ void tst_ChartDataSet::nextpreviousDomain() ChartDataSet dataSet; Domain domain1(0, 1000, 0, 1000); - QLineChartSeries* series = new QLineChartSeries(); + QLineSeries* series = new QLineSeries(); series->add(0, 0); series->add(1000, 1000); @@ -487,7 +487,7 @@ void tst_ChartDataSet::removeSeries() for (int i = 0; i < seriesCount; i++) { QChartAxis* axisY = 0; - QLineChartSeries* series = new QLineChartSeries(); + QLineSeries* series = new QLineSeries(); if (iterator != axisList.end()) { axisY = *iterator; iterator++; @@ -559,7 +559,7 @@ void tst_ChartDataSet::removeAllSeries() for (int i = 0; i < seriesCount; i++) { QChartAxis* axisY = 0; - QLineChartSeries* series = new QLineChartSeries(); + QLineSeries* series = new QLineSeries(); if (iterator != axisList.end()) { axisY = *iterator; iterator++; diff --git a/test/chartwidgettest/mainwidget.cpp b/test/chartwidgettest/mainwidget.cpp index 1c33d5b..539a23b 100644 --- a/test/chartwidgettest/mainwidget.cpp +++ b/test/chartwidgettest/mainwidget.cpp @@ -3,7 +3,7 @@ #include "qchartseries.h" #include "qpieseries.h" #include "qscatterseries.h" -#include +#include #include #include #include @@ -219,7 +219,7 @@ void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QS if (seriesName.contains("line", Qt::CaseInsensitive)) { for (int j(0); j < data.count(); j ++) { QList column = data.at(j); - QLineChartSeries *series = new QLineChartSeries(); + QLineSeries *series = new QLineSeries(); for (int i(0); i < column.count(); i++) { series->add(i, column.at(i)); }