diff --git a/example/barchart/main.cpp b/example/barchart/main.cpp index ed8b3c6..1cd392c 100644 --- a/example/barchart/main.cpp +++ b/example/barchart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) //! [3] // Create series and add sets to it - QBarChartSeries* series= new QBarChartSeries(category); + QBarSeries* series= new QBarSeries(category); series->addBarSet(set0); series->addBarSet(set1); diff --git a/example/chartview/main.cpp b/example/chartview/main.cpp index 1f7af3e..7d87cff 100644 --- a/example/chartview/main.cpp +++ b/example/chartview/main.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) *barCategory << "Jan" << "Feb" << "Mar"; - QBarChartSeries *bar = new QBarChartSeries(barCategory); + QBarSeries *bar = new QBarSeries(barCategory); QBarSet *barSet = new QBarSet("Sales"); *barSet << 123.2 << 301.3 diff --git a/example/gdpbarchart/widget.cpp b/example/gdpbarchart/widget.cpp index 20b5c74..aa8db21 100644 --- a/example/gdpbarchart/widget.cpp +++ b/example/gdpbarchart/widget.cpp @@ -124,7 +124,7 @@ void Widget::refreshChart() QBarCategory* category = new QBarCategory; for (int i = 0; i < selectedCountriesStrings.size(); i++) *category << selectedCountriesStrings[i]; - series0 = new QBarChartSeries(category); + series0 = new QBarSeries(category); // prepare the selected counries SQL query QString countriesQuery = "country IN ("; diff --git a/example/gdpbarchart/widget.h b/example/gdpbarchart/widget.h index 4debddb..8bde9b2 100644 --- a/example/gdpbarchart/widget.h +++ b/example/gdpbarchart/widget.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include QTCOMMERCIALCHART_USE_NAMESPACE @@ -28,7 +28,7 @@ private: QListWidget* countrieslist; QListWidget* yearslist; QSqlDatabase db; - QBarChartSeries* series0; + QBarSeries* series0; QRadioButton* barChartRadioButton; QRadioButton* scatterChartRadioButton; }; diff --git a/example/percentbarchart/main.cpp b/example/percentbarchart/main.cpp index 48a7069..bb238ea 100644 --- a/example/percentbarchart/main.cpp +++ b/example/percentbarchart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) //! [3] // Create series and add sets to it - QPercentBarChartSeries* series = new QPercentBarChartSeries(category); + QPercentBarSeries* series = new QPercentBarSeries(category); series->addBarSet(set0); series->addBarSet(set1); diff --git a/example/stackedbarchart/main.cpp b/example/stackedbarchart/main.cpp index 3dc8d00..18d21ac 100644 --- a/example/stackedbarchart/main.cpp +++ b/example/stackedbarchart/main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) //! [3] // Create series and add sets to it - QStackedBarChartSeries* series = new QStackedBarChartSeries(category); + QStackedBarSeries* series = new QStackedBarSeries(category); series->addBarSet(set0); series->addBarSet(set1); diff --git a/src/barchart/barchart.pri b/src/barchart/barchart.pri index 35668e6..0a98940 100644 --- a/src/barchart/barchart.pri +++ b/src/barchart/barchart.pri @@ -9,10 +9,10 @@ SOURCES += \ $$PWD/barpresenterbase.cpp \ $$PWD/percentbarpresenter.cpp \ $$PWD/qbarcategory.cpp \ - $$PWD/qbarchartseries.cpp \ + $$PWD/qbarseries.cpp \ $$PWD/qbarset.cpp \ - $$PWD/qpercentbarchartseries.cpp \ - $$PWD/qstackedbarchartseries.cpp \ + $$PWD/qpercentbarseries.cpp \ + $$PWD/qstackedbarseries.cpp \ $$PWD/separator.cpp \ $$PWD/stackedbarpresenter.cpp \ $$PWD/barvalue.cpp @@ -30,9 +30,9 @@ PRIVATE_HEADERS += \ PUBLIC_HEADERS += \ $$PWD/qbarcategory.h \ - $$PWD/qbarchartseries.h \ + $$PWD/qbarseries.h \ $$PWD/qbarset.h \ - $$PWD/qpercentbarchartseries.h \ - $$PWD/qstackedbarchartseries.h + $$PWD/qpercentbarseries.h \ + $$PWD/qstackedbarseries.h diff --git a/src/barchart/barpresenter.cpp b/src/barchart/barpresenter.cpp index 9e06f12..89b9fd7 100644 --- a/src/barchart/barpresenter.cpp +++ b/src/barchart/barpresenter.cpp @@ -7,7 +7,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -BarPresenter::BarPresenter(QBarChartSeries *series, QGraphicsItem *parent) : +BarPresenter::BarPresenter(QBarSeries *series, QGraphicsItem *parent) : BarPresenterBase(series, parent) { mBarDefaultWidth = 15; diff --git a/src/barchart/barpresenter.h b/src/barchart/barpresenter.h index 623ea6b..bbcd413 100644 --- a/src/barchart/barpresenter.h +++ b/src/barchart/barpresenter.h @@ -7,14 +7,14 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QBarChartSeries; +class QBarSeries; // Presenter for parallel bars. Grouping of bars is done on category basis. class BarPresenter : public BarPresenterBase { Q_OBJECT public: - explicit BarPresenter(QBarChartSeries *series, QGraphicsItem *parent = 0); + explicit BarPresenter(QBarSeries *series, QGraphicsItem *parent = 0); private: diff --git a/src/barchart/barpresenterbase.cpp b/src/barchart/barpresenterbase.cpp index dd21a43..07e9337 100644 --- a/src/barchart/barpresenterbase.cpp +++ b/src/barchart/barpresenterbase.cpp @@ -4,13 +4,13 @@ #include "barlabel_p.h" #include "separator_p.h" #include "qbarset.h" -#include "qbarchartseries.h" +#include "qbarseries.h" #include #include QTCOMMERCIALCHART_BEGIN_NAMESPACE -BarPresenterBase::BarPresenterBase(QBarChartSeries *series, QGraphicsItem *parent) +BarPresenterBase::BarPresenterBase(QBarSeries *series, QGraphicsItem *parent) : ChartItem(parent) ,mBarDefaultWidth(20) // TODO: remove hard coding, when we have layout code ready ,mLayoutSet(false) diff --git a/src/barchart/barpresenterbase.h b/src/barchart/barpresenterbase.h index 720ab44..c342ba1 100644 --- a/src/barchart/barpresenterbase.h +++ b/src/barchart/barpresenterbase.h @@ -2,7 +2,7 @@ #define BARPRESENTERBASE_H #include "chartitem_p.h" -#include "qbarchartseries.h" +#include "qbarseries.h" #include #include #include @@ -20,7 +20,7 @@ class BarPresenterBase : public QObject, public ChartItem { Q_OBJECT public: - BarPresenterBase(QBarChartSeries *series, QGraphicsItem *parent = 0); + BarPresenterBase(QBarSeries *series, QGraphicsItem *parent = 0); ~BarPresenterBase(); public: @@ -57,7 +57,7 @@ protected: bool mSeparatorsEnabled; // Owned - QBarChartSeries* mSeries; + QBarSeries* mSeries; // Not owned. QList mBars; diff --git a/src/barchart/percentbarpresenter.cpp b/src/barchart/percentbarpresenter.cpp index f620f80..5480f7e 100644 --- a/src/barchart/percentbarpresenter.cpp +++ b/src/barchart/percentbarpresenter.cpp @@ -9,7 +9,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -PercentBarPresenter::PercentBarPresenter(QBarChartSeries *series, QGraphicsItem *parent) : +PercentBarPresenter::PercentBarPresenter(QBarSeries *series, QGraphicsItem *parent) : BarPresenterBase(series, parent) { } diff --git a/src/barchart/percentbarpresenter.h b/src/barchart/percentbarpresenter.h index fa16399..e10fe27 100644 --- a/src/barchart/percentbarpresenter.h +++ b/src/barchart/percentbarpresenter.h @@ -3,7 +3,7 @@ #include "chartitem_p.h" #include "bar_p.h" -#include "qpercentbarchartseries.h" +#include "qpercentbarseries.h" #include "barpresenterbase.h" #include @@ -13,7 +13,7 @@ class PercentBarPresenter : public BarPresenterBase { Q_OBJECT public: - PercentBarPresenter(QBarChartSeries *series, QGraphicsItem *parent = 0); + PercentBarPresenter(QBarSeries *series, QGraphicsItem *parent = 0); private: diff --git a/src/barchart/qbarcategory.cpp b/src/barchart/qbarcategory.cpp index d2195fa..10b9b59 100644 --- a/src/barchart/qbarcategory.cpp +++ b/src/barchart/qbarcategory.cpp @@ -16,7 +16,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Example on how to create a category: \snippet ../example/barchart/main.cpp 1 - \sa QBarChartSeries, QStackedBarChartSeries, QPercentBarChartSeries + \sa QBarSeries, QStackedBarSeries, QPercentBarSeries */ /*! diff --git a/src/barchart/qbarchartseries.cpp b/src/barchart/qbarseries.cpp similarity index 80% rename from src/barchart/qbarchartseries.cpp rename to src/barchart/qbarseries.cpp index 9b4d9aa..e0dcfe5 100644 --- a/src/barchart/qbarchartseries.cpp +++ b/src/barchart/qbarseries.cpp @@ -1,5 +1,5 @@ #include -#include "qbarchartseries.h" +#include "qbarseries.h" #include "qbarcategory.h" #include "qbarset.h" #include "barchartmodel_p.h" @@ -8,11 +8,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! - \class QBarChartSeries + \class QBarSeries \brief part of QtCommercial chart API. - QBarChartSeries represents a series of data shown as bars. One QBarChartSeries can contain multible - QBarSet data sets. QBarChartSeries groups the data from sets to categories, which are defined + QBarSeries represents a series of data shown as bars. One QBarSeries can contain multible + QBarSet data sets. QBarSeries groups the data from sets to categories, which are defined by QBarCategory class. \mainclass @@ -32,41 +32,41 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Example on how to create view and apply theme: \snippet ../example/barchart/main.cpp 5 - \sa QBarCategory, QBarSet, QStackedBarChartSeries, QPercentBarChartSeries + \sa QBarCategory, QBarSet, QStackedBarSeries, QPercentBarSeries */ /*! - \fn virtual QChartSeriesType QBarChartSeries::type() const + \fn virtual QChartSeriesType QBarSeries::type() const \brief Returns type of series. \sa QChartSeries, QChartSeriesType */ /*! - \fn void QBarChartSeries::changed(int index) + \fn void QBarSeries::changed(int index) \brief \internal \a index */ /*! - \fn void QBarChartSeries::floatingValuesEnabled(bool enabled) + \fn void QBarSeries::floatingValuesEnabled(bool enabled) \brief \internal \a enabled */ /*! - \fn void QBarChartSeries::toolTipEnabled(bool enabled) + \fn void QBarSeries::toolTipEnabled(bool enabled) \brief \internal \a enabled */ /*! - \fn void QBarChartSeries::separatorsEnabled(bool enabled) + \fn void QBarSeries::separatorsEnabled(bool enabled) \brief \internal \a enabled */ /*! - \fn void QBarChartSeries::showToolTip(QPoint pos, QString tip) + \fn void QBarSeries::showToolTip(QPoint pos, QString tip) \brief \internal \a pos \a tip */ /*! - Constructs empty QBarChartSeries. Parameter \a category defines the categories for chart. + Constructs empty QBarSeries. Parameter \a category defines the categories for chart. Takes ownership of \a category. - QBarChartSeries is QObject which is a child of a \a parent. + QBarSeries is QObject which is a child of a \a parent. */ -QBarChartSeries::QBarChartSeries(QBarCategory *category, QObject *parent) +QBarSeries::QBarSeries(QBarCategory *category, QObject *parent) : QChartSeries(parent) ,mModel(new BarChartModel(category, this)) { @@ -75,7 +75,7 @@ QBarChartSeries::QBarChartSeries(QBarCategory *category, QObject *parent) /*! Adds a set of bars to series. Takes ownership of \a set */ -void QBarChartSeries::addBarSet(QBarSet *set) +void QBarSeries::addBarSet(QBarSet *set) { mModel->addBarSet(set); } @@ -83,7 +83,7 @@ void QBarChartSeries::addBarSet(QBarSet *set) /*! Removes a set of bars from series. Releases ownership of \a set. Doesnt delete \a set. */ -void QBarChartSeries::removeBarSet(QBarSet *set) +void QBarSeries::removeBarSet(QBarSet *set) { mModel->removeBarSet(set); } @@ -91,7 +91,7 @@ void QBarChartSeries::removeBarSet(QBarSet *set) /*! Returns number of sets in series. */ -int QBarChartSeries::countSets() +int QBarSeries::countSets() { return mModel->countSets(); } @@ -99,7 +99,7 @@ int QBarChartSeries::countSets() /*! Returns number of categories in series */ -int QBarChartSeries::countCategories() +int QBarSeries::countCategories() { return mModel->countCategories(); } @@ -110,7 +110,7 @@ int QBarChartSeries::countCategories() If series is empty, returns 0. Returns 0 after last set. */ -QBarSet* QBarChartSeries::nextSet(bool getFirst) +QBarSet* QBarSeries::nextSet(bool getFirst) { return mModel->nextSet(getFirst); } @@ -120,7 +120,7 @@ QBarSet* QBarChartSeries::nextSet(bool getFirst) Assumes that \a index is between 0 and number of sets. Use countSets() to get valid index bound. \sa countSets() */ -QBarSet* QBarChartSeries::setAt(int index) +QBarSet* QBarSeries::setAt(int index) { return mModel->setAt(index); } @@ -128,7 +128,7 @@ QBarSet* QBarChartSeries::setAt(int index) /*! Returns legend of series. Legend is a list of set names in series. */ -QList QBarChartSeries::legend() +QList QBarSeries::legend() { return mModel->legend(); } @@ -136,7 +136,7 @@ QList QBarChartSeries::legend() /*! \internal \a category */ -QString QBarChartSeries::label(int category) +QString QBarSeries::label(int category) { return mModel->label(category); } @@ -146,7 +146,7 @@ QString QBarChartSeries::label(int category) Floating values are bar values, that are displayed on top of each bar. Calling without parameter \a enabled, enables the floating values */ -void QBarChartSeries::enableFloatingValues(bool enabled) +void QBarSeries::enableFloatingValues(bool enabled) { if (enabled) { for (int i=0; icountSets(); i++) { @@ -166,7 +166,7 @@ void QBarChartSeries::enableFloatingValues(bool enabled) Tooltip shows the name of set, when mouse is hovering on top of bar. Calling without parameter \a enabled, enables the tooltip */ -void QBarChartSeries::enableToolTip(bool enabled) +void QBarSeries::enableToolTip(bool enabled) { if (enabled) { for (int i=0; icountSets(); i++) { @@ -186,7 +186,7 @@ void QBarChartSeries::enableToolTip(bool enabled) Separators are visual elements that are drawn between categories. Calling without parameter \a enabled, enables the separators */ -void QBarChartSeries::enableSeparators(bool enabled) +void QBarSeries::enableSeparators(bool enabled) { emit separatorsEnabled(enabled); } @@ -194,7 +194,7 @@ void QBarChartSeries::enableSeparators(bool enabled) /*! \internal */ -qreal QBarChartSeries::min() +qreal QBarSeries::min() { return mModel->min(); } @@ -202,7 +202,7 @@ qreal QBarChartSeries::min() /*! \internal */ -qreal QBarChartSeries::max() +qreal QBarSeries::max() { return mModel->max(); } @@ -210,7 +210,7 @@ qreal QBarChartSeries::max() /*! \internal \a set \a category */ -qreal QBarChartSeries::valueAt(int set, int category) +qreal QBarSeries::valueAt(int set, int category) { return mModel->valueAt(set,category); } @@ -218,7 +218,7 @@ qreal QBarChartSeries::valueAt(int set, int category) /*! \internal \a set \a category */ -qreal QBarChartSeries::percentageAt(int set, int category) +qreal QBarSeries::percentageAt(int set, int category) { return mModel->percentageAt(set,category); } @@ -226,7 +226,7 @@ qreal QBarChartSeries::percentageAt(int set, int category) /*! \internal \a category */ -qreal QBarChartSeries::categorySum(int category) +qreal QBarSeries::categorySum(int category) { return mModel->categorySum(category); } @@ -234,7 +234,7 @@ qreal QBarChartSeries::categorySum(int category) /*! \internal */ -qreal QBarChartSeries::maxCategorySum() +qreal QBarSeries::maxCategorySum() { return mModel->maxCategorySum(); } @@ -242,11 +242,11 @@ qreal QBarChartSeries::maxCategorySum() /*! \internal */ -BarChartModel& QBarChartSeries::model() +BarChartModel& QBarSeries::model() { return *mModel; } -#include "moc_qbarchartseries.cpp" +#include "moc_qbarseries.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qbarchartseries.h b/src/barchart/qbarseries.h similarity index 91% rename from src/barchart/qbarchartseries.h rename to src/barchart/qbarseries.h index e3db2be..575e30f 100644 --- a/src/barchart/qbarchartseries.h +++ b/src/barchart/qbarseries.h @@ -1,5 +1,5 @@ -#ifndef BARCHARTSERIES_H -#define BARCHARTSERIES_H +#ifndef BARSERIES_H +#define BARSERIES_H #include "qchartseries.h" @@ -10,11 +10,11 @@ class QBarSet; class BarChartModel; // Container for series -class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries +class QTCOMMERCIALCHART_EXPORT QBarSeries : public QChartSeries { Q_OBJECT public: - QBarChartSeries(QBarCategory *category, QObject* parent=0); + QBarSeries(QBarCategory *category, QObject* parent=0); virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; } @@ -63,4 +63,4 @@ protected: QTCOMMERCIALCHART_END_NAMESPACE -#endif // BARCHARTSERIES_H +#endif // BARSERIES_H diff --git a/src/barchart/qbarset.cpp b/src/barchart/qbarset.cpp index 962ea5f..2c88969 100644 --- a/src/barchart/qbarset.cpp +++ b/src/barchart/qbarset.cpp @@ -18,7 +18,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Example on how to create sets of data: \snippet ../example/barchart/main.cpp 2 - \sa QBarCategory, QBarChartSeries, QStackedBarChartSeries, QPercentBarChartSeries + \sa QBarCategory, QBarSeries, QStackedBarSeries, QPercentBarSeries */ /*! diff --git a/src/barchart/qstackedbarchartseries.cpp b/src/barchart/qpercentbarseries.cpp similarity index 59% rename from src/barchart/qstackedbarchartseries.cpp rename to src/barchart/qpercentbarseries.cpp index 280ee97..a1327b1 100644 --- a/src/barchart/qstackedbarchartseries.cpp +++ b/src/barchart/qpercentbarseries.cpp @@ -1,14 +1,14 @@ -#include "qstackedbarchartseries.h" +#include "qpercentbarseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! - \class QStackedBarChartSeries + \class QPercentBarSeries \brief part of QtCommercial chart API. - QStackedBarChartSeries represents a series of data shown as bars. All bars in same category are - stacked on top of each other. One QStackedBarChartSeries can contain multible QBarSet data sets. - QStackedBarChartSeries groups the data from sets to categories, which are defined by QBarCategory class. + QPercentBarSeries represents a series of data shown as bars. Each bar of QBarSet is shown as percentage + of all bars in category. One QPercentBarSeries can contain multible QBarSet data sets. + QBarSeries groups the data from sets to categories, which are defined by QBarCategory class. \mainclass @@ -27,25 +27,25 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Example on how to create view and apply theme: \snippet ../example/barchart/main.cpp 5 - \sa QBarCategory, QBarSet, QPercentBarChartSeries, QBarChartSeries + \sa QBarCategory, QBarSet, QStackedBarSeries, QBarSeries */ /*! - \fn virtual QChartSeriesType QStackedBarChartSeries::type() const + \fn virtual QChartSeriesType QPercentBarSeries::type() const \brief Returns type of series. \sa QChartSeries, QChartSeriesType */ /*! - Constructs empty QStackedBarChartSeries. Parameter \a category defines the categories for chart. - QStackedBarChartSeries is QObject which is a child of a \a parent. + Constructs empty QPercentBarSeries. Parameter \a category defines the categories for chart. + QPercentBarSeries is QObject which is a child of a \a parent. */ -QStackedBarChartSeries::QStackedBarChartSeries(QBarCategory *category, QObject *parent) - : QBarChartSeries(category, parent) +QPercentBarSeries::QPercentBarSeries(QBarCategory *category, QObject *parent) + : QBarSeries(category, parent) { } -#include "moc_qstackedbarchartseries.cpp" +#include "moc_qpercentbarseries.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qpercentbarchartseries.h b/src/barchart/qpercentbarseries.h similarity index 57% rename from src/barchart/qpercentbarchartseries.h rename to src/barchart/qpercentbarseries.h index 44f3cf1..e1ebdc7 100644 --- a/src/barchart/qpercentbarchartseries.h +++ b/src/barchart/qpercentbarseries.h @@ -1,15 +1,15 @@ -#ifndef PERCENTBARCHARTSERIES_H -#define PERCENTBARCHARTSERIES_H +#ifndef PERCENTBARSERIES_H +#define PERCENTBARSERIES_H -#include "qbarchartseries.h" +#include "qbarseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QTCOMMERCIALCHART_EXPORT QPercentBarChartSeries : public QBarChartSeries +class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QBarSeries { Q_OBJECT public: - QPercentBarChartSeries(QBarCategory *category, QObject* parent=0); + QPercentBarSeries(QBarCategory *category, QObject* parent=0); virtual QChartSeriesType type() const { return QChartSeries::SeriesTypePercentBar; } }; @@ -17,4 +17,4 @@ public: QTCOMMERCIALCHART_END_NAMESPACE -#endif // PERCENTBARCHARTSERIES_H +#endif // PERCENTBARSERIES_H diff --git a/src/barchart/qpercentbarchartseries.cpp b/src/barchart/qstackedbarseries.cpp similarity index 61% rename from src/barchart/qpercentbarchartseries.cpp rename to src/barchart/qstackedbarseries.cpp index 76c320e..dbffef5 100644 --- a/src/barchart/qpercentbarchartseries.cpp +++ b/src/barchart/qstackedbarseries.cpp @@ -1,14 +1,14 @@ -#include "qpercentbarchartseries.h" +#include "qstackedbarseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! - \class QPercentBarChartSeries + \class QStackedBarSeries \brief part of QtCommercial chart API. - QPercentBarChartSeries represents a series of data shown as bars. Each bar of QBarSet is shown as percentage - of all bars in category. One QPercentBarChartSeries can contain multible QBarSet data sets. - QBarChartSeries groups the data from sets to categories, which are defined by QBarCategory class. + QStackedBarSeries represents a series of data shown as bars. All bars in same category are + stacked on top of each other. One QStackedBarSeries can contain multible QBarSet data sets. + QStackedBarSeries groups the data from sets to categories, which are defined by QBarCategory class. \mainclass @@ -27,25 +27,25 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Example on how to create view and apply theme: \snippet ../example/barchart/main.cpp 5 - \sa QBarCategory, QBarSet, QStackedBarChartSeries, QBarChartSeries + \sa QBarCategory, QBarSet, QPercentBarSeries, QBarSeries */ /*! - \fn virtual QChartSeriesType QPercentBarChartSeries::type() const + \fn virtual QChartSeriesType QStackedBarSeries::type() const \brief Returns type of series. \sa QChartSeries, QChartSeriesType */ /*! - Constructs empty QPercentBarChartSeries. Parameter \a category defines the categories for chart. - QPercentBarChartSeries is QObject which is a child of a \a parent. + Constructs empty QStackedBarSeries. Parameter \a category defines the categories for chart. + QStackedBarSeries is QObject which is a child of a \a parent. */ -QPercentBarChartSeries::QPercentBarChartSeries(QBarCategory *category, QObject *parent) - : QBarChartSeries(category, parent) +QStackedBarSeries::QStackedBarSeries(QBarCategory *category, QObject *parent) + : QBarSeries(category, parent) { } -#include "moc_qpercentbarchartseries.cpp" +#include "moc_qstackedbarseries.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qstackedbarchartseries.h b/src/barchart/qstackedbarseries.h similarity index 60% rename from src/barchart/qstackedbarchartseries.h rename to src/barchart/qstackedbarseries.h index d2f3726..8df7cc0 100644 --- a/src/barchart/qstackedbarchartseries.h +++ b/src/barchart/qstackedbarseries.h @@ -1,21 +1,21 @@ -#ifndef STACKEDBARCHARTSERIES_H -#define STACKEDBARCHARTSERIES_H +#ifndef STACKEDBARSERIES_H +#define STACKEDBARSERIES_H -#include "qbarchartseries.h" +#include "qbarseries.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE class QBarCategory; -class QTCOMMERCIALCHART_EXPORT QStackedBarChartSeries : public QBarChartSeries +class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QBarSeries { Q_OBJECT public: - QStackedBarChartSeries(QBarCategory *category, QObject* parent=0); + QStackedBarSeries(QBarCategory *category, QObject* parent=0); virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeStackedBar; } }; QTCOMMERCIALCHART_END_NAMESPACE -#endif // STACKEDBARCHARTSERIES_H +#endif // STACKEDBARSERIES_H diff --git a/src/barchart/stackedbarpresenter.cpp b/src/barchart/stackedbarpresenter.cpp index 644548c..0397f93 100644 --- a/src/barchart/stackedbarpresenter.cpp +++ b/src/barchart/stackedbarpresenter.cpp @@ -8,7 +8,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -StackedBarPresenter::StackedBarPresenter(QBarChartSeries *series, QGraphicsItem *parent) : +StackedBarPresenter::StackedBarPresenter(QBarSeries *series, QGraphicsItem *parent) : BarPresenterBase(series,parent) { } diff --git a/src/barchart/stackedbarpresenter.h b/src/barchart/stackedbarpresenter.h index a3afa29..4050bda 100644 --- a/src/barchart/stackedbarpresenter.h +++ b/src/barchart/stackedbarpresenter.h @@ -2,7 +2,7 @@ #define STACKEDBARPRESENTER_H #include "barpresenterbase.h" -#include "qstackedbarchartseries.h" +#include "qstackedbarseries.h" #include QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -11,7 +11,7 @@ class StackedBarPresenter : public BarPresenterBase { Q_OBJECT public: - StackedBarPresenter(QBarChartSeries *series, QGraphicsItem *parent = 0); + StackedBarPresenter(QBarSeries *series, QGraphicsItem *parent = 0); private: // From BarPresenterBase diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index 1fbdd18..a15aba8 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -2,9 +2,9 @@ #include "qchartaxis.h" //series #include "qlinechartseries.h" -#include "qbarchartseries.h" -#include "qstackedbarchartseries.h" -#include "qpercentbarchartseries.h" +#include "qbarseries.h" +#include "qstackedbarseries.h" +#include "qpercentbarseries.h" #include "qpieseries.h" #include "qscatterseries.h" @@ -72,7 +72,7 @@ void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) } case QChartSeries::SeriesTypeBar: { qDebug() << "QChartSeries::SeriesTypeBar"; - QBarChartSeries* barSeries = static_cast(series); + QBarSeries* barSeries = static_cast(series); qreal x = barSeries->countCategories(); qreal y = barSeries->max(); domain.m_minX = qMin(domain.m_minX,x); @@ -84,7 +84,7 @@ void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) case QChartSeries::SeriesTypeStackedBar: { qDebug() << "QChartSeries::SeriesTypeStackedBar"; - QStackedBarChartSeries* stackedBarSeries = static_cast(series); + QStackedBarSeries* stackedBarSeries = static_cast(series); qreal x = stackedBarSeries->countCategories(); qreal y = stackedBarSeries->maxCategorySum(); domain.m_minX = qMin(domain.m_minX,x); @@ -96,7 +96,7 @@ void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) case QChartSeries::SeriesTypePercentBar: { qDebug() << "QChartSeries::SeriesTypePercentBar"; - QPercentBarChartSeries* percentBarSeries = static_cast(series); + QPercentBarSeries* percentBarSeries = static_cast(series); qreal x = percentBarSeries->countCategories(); domain.m_minX = qMin(domain.m_minX,x); domain.m_minY = 0; diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index 8d5c60b..2f47352 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -4,9 +4,9 @@ #include "chartdataset_p.h" #include "charttheme_p.h" //series -#include "qbarchartseries.h" -#include "qstackedbarchartseries.h" -#include "qpercentbarchartseries.h" +#include "qbarseries.h" +#include "qstackedbarseries.h" +#include "qpercentbarseries.h" #include "qlinechartseries.h" #include "qpieseries.h" #include "qscatterseries.h" @@ -124,7 +124,7 @@ void ChartPresenter::handleSeriesAdded(QChartSeries* series) } case QChartSeries::SeriesTypeBar: { - QBarChartSeries* barSeries = static_cast(series); + QBarSeries* barSeries = static_cast(series); BarPresenter* item = new BarPresenter(barSeries,m_chart); m_chartTheme->decorate(item,barSeries,m_chartItems.count()); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),item,SLOT(handleGeometryChanged(const QRectF&))); @@ -136,7 +136,7 @@ void ChartPresenter::handleSeriesAdded(QChartSeries* series) case QChartSeries::SeriesTypeStackedBar: { - QStackedBarChartSeries* stackedBarSeries = static_cast(series); + QStackedBarSeries* stackedBarSeries = static_cast(series); StackedBarPresenter* item = new StackedBarPresenter(stackedBarSeries,m_chart); m_chartTheme->decorate(item,stackedBarSeries,m_chartItems.count()); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),item,SLOT(handleGeometryChanged(const QRectF&))); @@ -147,7 +147,7 @@ void ChartPresenter::handleSeriesAdded(QChartSeries* series) case QChartSeries::SeriesTypePercentBar: { - QPercentBarChartSeries* percentBarSeries = static_cast(series); + QPercentBarSeries* percentBarSeries = static_cast(series); PercentBarPresenter* item = new PercentBarPresenter(percentBarSeries,m_chart); m_chartTheme->decorate(item,percentBarSeries ,m_chartItems.count()); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),item,SLOT(handleGeometryChanged(const QRectF&))); diff --git a/src/charttheme.cpp b/src/charttheme.cpp index aadee2b..26d6ba4 100644 --- a/src/charttheme.cpp +++ b/src/charttheme.cpp @@ -5,9 +5,9 @@ //series #include "qbarset.h" -#include "qbarchartseries.h" -#include "qstackedbarchartseries.h" -#include "qpercentbarchartseries.h" +#include "qbarseries.h" +#include "qstackedbarseries.h" +#include "qpercentbarseries.h" #include "qlinechartseries.h" #include "qscatterseries.h" #include "qpieseries.h" @@ -91,19 +91,19 @@ void ChartTheme::decorate(ChartItem* item, QChartSeries* series,int count) break; } case QChartSeries::SeriesTypeBar: { - QBarChartSeries* b = static_cast(series); + QBarSeries* b = static_cast(series); BarPresenter* i = static_cast(item); decorate(i,b,count); break; } case QChartSeries::SeriesTypeStackedBar: { - QStackedBarChartSeries* s = static_cast(series); + QStackedBarSeries* s = static_cast(series); StackedBarPresenter* i = static_cast(item); decorate(i,s,count); break; } case QChartSeries::SeriesTypePercentBar: { - QPercentBarChartSeries* s = static_cast(series); + QPercentBarSeries* s = static_cast(series); PercentBarPresenter* i = static_cast(item); decorate(i,s,count); break; @@ -141,21 +141,21 @@ void ChartTheme::decorate(LineChartItem* item, QLineChartSeries* series,int coun item->setPen(pen); } -void ChartTheme::decorate(BarPresenter* item, QBarChartSeries* series,int count) +void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int count) { for (int i=0; icountSets(); i++) { series->nextSet(0==i)->setBrush(QBrush(m_seriesColor.at(i%m_seriesColor.count()))); } } -void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarChartSeries* series,int count) +void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count) { for (int i=0; icountSets(); i++) { series->nextSet(0==i)->setBrush(QBrush(m_seriesColor.at(i%m_seriesColor.count()))); } } -void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarChartSeries* series,int count) +void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count) { for (int i=0; icountSets(); i++) { series->nextSet(0==i)->setBrush(QBrush(m_seriesColor.at(i%m_seriesColor.count()))); diff --git a/src/charttheme_p.h b/src/charttheme_p.h index 86eeb20..4320cf6 100644 --- a/src/charttheme_p.h +++ b/src/charttheme_p.h @@ -12,10 +12,10 @@ class QChartSeries; class LineChartItem; class QLineChartSeries; class BarPresenter; -class QBarChartSeries; +class QBarSeries; class StackedBarPresenter; -class QStackedBarChartSeries; -class QPercentBarChartSeries; +class QStackedBarSeries; +class QPercentBarSeries; class PercentBarPresenter; class QScatterSeries; class ScatterPresenter; @@ -32,9 +32,9 @@ public: void decorate(QChart* chart); void decorate(ChartItem* item, QChartSeries* series,int count); void decorate(LineChartItem* item, QLineChartSeries*, int count); - void decorate(BarPresenter* item, QBarChartSeries* series,int count); - void decorate(StackedBarPresenter* item, QStackedBarChartSeries* series,int count); - void decorate(PercentBarPresenter* item, QPercentBarChartSeries* series,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(ScatterPresenter* presenter, QScatterSeries* series, int count); void decorate(PiePresenter* item, QPieSeries* series, int count); void decorate(QChartAxis* axis,AxisItem* item); diff --git a/test/chartwidgettest/mainwidget.cpp b/test/chartwidgettest/mainwidget.cpp index 735ecce..1c33d5b 100644 --- a/test/chartwidgettest/mainwidget.cpp +++ b/test/chartwidgettest/mainwidget.cpp @@ -6,9 +6,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -255,13 +255,13 @@ void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QS QStringList labels = generateLabels(rowCount); foreach(QString label, labels) *category << label; - QBarChartSeries* series = 0; + QBarSeries* series = 0; if (seriesName == "Bar") - series = new QBarChartSeries(category, this); + series = new QBarSeries(category, this); else if (seriesName == "Stacked bar") - series = new QStackedBarChartSeries(category, this); + series = new QStackedBarSeries(category, this); else - series = new QPercentBarChartSeries(category, this); + series = new QPercentBarSeries(category, this); for (int j(0); j < data.count(); j++) { QList column = data.at(j);