diff --git a/config.pri b/config.pri index 9c03be9..ea1e403 100644 --- a/config.pri +++ b/config.pri @@ -108,7 +108,7 @@ development_build: { } } -}else { +} else { CONFIG += qtcommercialchart diff --git a/examples/customchart/main.cpp b/examples/customchart/main.cpp index ee650b0..1f5e9b2 100644 --- a/examples/customchart/main.cpp +++ b/examples/customchart/main.cpp @@ -89,12 +89,12 @@ int main(int argc, char *argv[]) //![3] //![4] - QChartAxisCategories* categoriesX = chart->axisX()->categories(); + QAxisCategories* categoriesX = chart->axisX()->categories(); categoriesX->insert(1,"low"); categoriesX->insert(5,"optimal"); categoriesX->insert(10,"high"); - QChartAxisCategories* categoriesY = chart->axisY()->categories(); + QAxisCategories* categoriesY = chart->axisY()->categories(); categoriesY->insert(1,"slow"); categoriesY->insert(5,"med"); categoriesY->insert(10,"fast"); diff --git a/src/axis/axis.pri b/src/axis/axis.pri index 8a78b3b..1579635 100644 --- a/src/axis/axis.pri +++ b/src/axis/axis.pri @@ -4,13 +4,13 @@ DEPENDPATH += $$PWD SOURCES += \ $$PWD/chartaxis.cpp \ $$PWD/qaxis.cpp \ - $$PWD/qchartaxiscategories.cpp + $$PWD/qaxiscategories.cpp PRIVATE_HEADERS += \ $$PWD/chartaxis_p.h \ $$PWD/qaxis_p.h \ - $$PWD/qchartaxiscategories_p.h + $$PWD/qaxiscategories_p.h PUBLIC_HEADERS += \ $$PWD/qaxis.h \ - $$PWD/qchartaxiscategories.h \ No newline at end of file + $$PWD/qaxiscategories.h \ No newline at end of file diff --git a/src/axis/chartaxis.cpp b/src/axis/chartaxis.cpp index 8243c6c..282a452 100644 --- a/src/axis/chartaxis.cpp +++ b/src/axis/chartaxis.cpp @@ -21,7 +21,7 @@ #include "chartaxis_p.h" #include "qaxis.h" #include "qaxis_p.h" -#include "qchartaxiscategories_p.h" +#include "qaxiscategories_p.h" #include "chartpresenter_p.h" #include "chartanimator_p.h" #include @@ -103,7 +103,7 @@ bool ChartAxis::createLabels(QStringList &labels,qreal min, qreal max,int ticks) Q_ASSERT(max>=min); Q_ASSERT(ticks>1); - QChartAxisCategories* categories = m_chartAxis->categories(); + QAxisCategories* categories = m_chartAxis->categories(); bool category = categories->count()>0; diff --git a/src/axis/qaxis.cpp b/src/axis/qaxis.cpp index 821fa18..7689ae0 100644 --- a/src/axis/qaxis.cpp +++ b/src/axis/qaxis.cpp @@ -493,7 +493,7 @@ bool QAxis::niceNumbersEnabled() const return d_ptr->m_niceNumbers; } -QChartAxisCategories* QAxis::categories() +QAxisCategories* QAxis::categories() { return &d_ptr->m_category; } diff --git a/src/axis/qaxis.h b/src/axis/qaxis.h index 4078161..5135753 100644 --- a/src/axis/qaxis.h +++ b/src/axis/qaxis.h @@ -22,7 +22,7 @@ #define QAXIS_H #include -#include +#include #include #include @@ -86,7 +86,7 @@ public: void setNiceNumbersEnabled(bool enable = true); bool niceNumbersEnabled() const; - QChartAxisCategories* categories(); + QAxisCategories* categories(); void show(); void hide(); diff --git a/src/axis/qaxis_p.h b/src/axis/qaxis_p.h index e6941a3..df7869d 100644 --- a/src/axis/qaxis_p.h +++ b/src/axis/qaxis_p.h @@ -73,7 +73,7 @@ private: qreal m_max; int m_ticksCount; - QChartAxisCategories m_category; + QAxisCategories m_category; bool m_niceNumbers; diff --git a/src/axis/qchartaxiscategories.cpp b/src/axis/qaxiscategories.cpp similarity index 78% rename from src/axis/qchartaxiscategories.cpp rename to src/axis/qaxiscategories.cpp index 83e5742..e6616fa 100644 --- a/src/axis/qchartaxiscategories.cpp +++ b/src/axis/qaxiscategories.cpp @@ -18,23 +18,23 @@ ** ****************************************************************************/ -#include "qchartaxiscategories.h" -#include "qchartaxiscategories_p.h" +#include "qaxiscategories.h" +#include "qaxiscategories_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE -QChartAxisCategories::QChartAxisCategories(): -d_ptr(new QChartAxisCategoriesPrivate(this)) +QAxisCategories::QAxisCategories(): +d_ptr(new QAxisCategoriesPrivate(this)) { } -QChartAxisCategories::~QChartAxisCategories() +QAxisCategories::~QAxisCategories() { } -void QChartAxisCategories::insert(const QBarCategories &categories) +void QAxisCategories::insert(const QBarCategories &categories) { int i=1; foreach (const QString& string , categories) { @@ -44,53 +44,53 @@ void QChartAxisCategories::insert(const QBarCategories &categories) emit d_ptr->updated(); } -void QChartAxisCategories::insert(qreal value,QString label) +void QAxisCategories::insert(qreal value,QString label) { d_ptr->m_map.insert(value,label); emit d_ptr->updated(); } -void QChartAxisCategories::remove(qreal value) +void QAxisCategories::remove(qreal value) { d_ptr->m_map.remove(value); emit d_ptr->updated(); } -void QChartAxisCategories::clear() +void QAxisCategories::clear() { d_ptr->m_map.clear(); emit d_ptr->updated(); } -int QChartAxisCategories::count() +int QAxisCategories::count() { return d_ptr->m_map.count(); } -QList QChartAxisCategories::values() const +QList QAxisCategories::values() const { return d_ptr->m_map.keys(); } -QString QChartAxisCategories::label(qreal value) const +QString QAxisCategories::label(qreal value) const { return d_ptr->m_map.value(value); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QChartAxisCategoriesPrivate::QChartAxisCategoriesPrivate(QChartAxisCategories *q): +QAxisCategoriesPrivate::QAxisCategoriesPrivate(QAxisCategories *q): q_ptr(q) { } -QChartAxisCategoriesPrivate::~QChartAxisCategoriesPrivate() +QAxisCategoriesPrivate::~QAxisCategoriesPrivate() { } -#include "moc_qchartaxiscategories.cpp" -#include "moc_qchartaxiscategories_p.cpp" +#include "moc_qaxiscategories.cpp" +#include "moc_qaxiscategories_p.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/qchartaxiscategories.h b/src/axis/qaxiscategories.h similarity index 84% rename from src/axis/qchartaxiscategories.h rename to src/axis/qaxiscategories.h index 09cc99b..bfae20c 100644 --- a/src/axis/qchartaxiscategories.h +++ b/src/axis/qaxiscategories.h @@ -18,23 +18,23 @@ ** ****************************************************************************/ -#ifndef QCHARTAXISCATEGORIES_H -#define QCHARTAXISCATEGORIES_H +#ifndef QAXISCATEGORIES_H +#define QAXISCATEGORIES_H #include #include QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxisCategoriesPrivate; +class QAxisCategoriesPrivate; -class QTCOMMERCIALCHART_EXPORT QChartAxisCategories : public QObject +class QTCOMMERCIALCHART_EXPORT QAxisCategories : public QObject { Q_OBJECT private: - QChartAxisCategories(); + QAxisCategories(); public: - ~QChartAxisCategories(); + ~QAxisCategories(); void insert(const QBarCategories &category); void insert(qreal value,QString label); @@ -45,7 +45,7 @@ public: int count(); private: - QScopedPointer d_ptr; + QScopedPointer d_ptr; friend class QAxisPrivate; friend class ChartAxis; }; diff --git a/src/axis/qchartaxiscategories_p.h b/src/axis/qaxiscategories_p.h similarity index 82% rename from src/axis/qchartaxiscategories_p.h rename to src/axis/qaxiscategories_p.h index d718dd3..88082c6 100644 --- a/src/axis/qchartaxiscategories_p.h +++ b/src/axis/qaxiscategories_p.h @@ -27,28 +27,28 @@ // // We mean it. -#ifndef QCHARTAXISCATEGORIES_P_H -#define QCHARTAXISCATEGORIES_P_H +#ifndef QAXISCATEGORIES_P_H +#define QAXISCATEGORIES_P_H -#include "qchartaxiscategories.h" +#include "qaxiscategories.h" #include QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxisCategoriesPrivate : public QObject +class QAxisCategoriesPrivate : public QObject { Q_OBJECT public: - QChartAxisCategoriesPrivate(QChartAxisCategories *q); - ~QChartAxisCategoriesPrivate(); + QAxisCategoriesPrivate(QAxisCategories *q); + ~QAxisCategoriesPrivate(); Q_SIGNALS: void updated(); private: - QChartAxisCategories *q_ptr; + QAxisCategories *q_ptr; QMap m_map; - friend class QChartAxisCategories; + friend class QAxisCategories; }; diff --git a/src/barchart/barchartitem.cpp b/src/barchart/barchartitem.cpp index 25f8720..0ecf8c4 100644 --- a/src/barchart/barchartitem.cpp +++ b/src/barchart/barchartitem.cpp @@ -26,8 +26,6 @@ #include "qbarseries.h" #include "qbarseries_p.h" #include "qchart.h" -//#include "qchartaxis.h" -#include "qchartaxiscategories.h" #include "chartpresenter_p.h" #include "chartanimator_p.h" #include "chartdataset_p.h" diff --git a/src/barchart/barchartitem_p.h b/src/barchart/barchartitem_p.h index 755c0dc..ed12a33 100644 --- a/src/barchart/barchartitem_p.h +++ b/src/barchart/barchartitem_p.h @@ -30,7 +30,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class Bar; class BarLabel; -class QChartAxisCategories; +class QAxisCategories; class QChart; //typedef QVector BarLayout; diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index ce68fc7..990d902 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -168,7 +168,7 @@ void ChartDataSet::removeAllSeries() void ChartDataSet::setupCategories(QBarSeries* series) { - QChartAxisCategories* categories = axisX()->categories(); + QAxisCategories* categories = axisX()->categories(); categories->clear(); categories->insert(series->categories()); }