From 97e8d42197e708e63bde87f7ae7d66f0d321bc73 2012-02-20 12:50:09 From: sauimone Date: 2012-02-20 12:50:09 Subject: [PATCH] moved presenter to private headers. code cleanup --- diff --git a/src/barchart/barpresenter.h b/src/barchart/barpresenter.h index 77e2f96..036f6ef 100644 --- a/src/barchart/barpresenter.h +++ b/src/barchart/barpresenter.h @@ -1,5 +1,5 @@ -#ifndef QBARGROUP_H -#define QBARGROUP_H +#ifndef BARPRESENTER_H +#define BARPRESENTER_H #include "barpresenterbase.h" #include "qbarchartseries.h" @@ -16,7 +16,7 @@ public: private: - // From BarGroupBase + // From BarPresenterBase void layoutChanged(); // layout has changed -> need to recalculate bar sizes private: @@ -25,4 +25,4 @@ private: QTCOMMERCIALCHART_END_NAMESPACE -#endif // QBARGROUP_H +#endif // BARPRESENTER_H diff --git a/src/barchart/barpresenterbase.cpp b/src/barchart/barpresenterbase.cpp index 4c96686..4a7cc38 100644 --- a/src/barchart/barpresenterbase.cpp +++ b/src/barchart/barpresenterbase.cpp @@ -46,17 +46,7 @@ void BarPresenterBase::setBarWidth( int w ) { mBarDefaultWidth = w; } -/* -void BarGroupBase::resetBrushes() -{ - mBrushes.clear(); -} -void BarGroupBase::addBrush(QBrush brush) -{ - mBrushes.append(brush); -} -*/ void BarPresenterBase::dataChanged() { // TODO: performance optimizations. Do we really need to delete and create items every time data is changed or can we reuse them? diff --git a/src/barchart/barpresenterbase.h b/src/barchart/barpresenterbase.h index 18828b6..bb8dc8f 100644 --- a/src/barchart/barpresenterbase.h +++ b/src/barchart/barpresenterbase.h @@ -1,5 +1,5 @@ -#ifndef BARGROUPBASE_H -#define BARGROUPBASE_H +#ifndef BARPRESENTERBASE_H +#define BARPRESENTERBASE_H #include "chartitem_p.h" #include "barchartmodel_p.h" @@ -26,16 +26,12 @@ public: // TODO: these may change with layout awarness. void setBarWidth( int w ); -// void resetBrushes(); -// void addBrush(QBrush brush); - void setPen(QPen pen); QPen pen(); void setBrush(QBrush brush); QBrush brush(); - // TODO: Consider the domain for layoutChanged. May be use case, may not be. If it is, then the derived classes need to implement it virtual void dataChanged(); // data of series has changed -> need to recalculate bar sizes virtual void layoutChanged() = 0; // layout has changed -> need to recalculate bar sizes @@ -60,9 +56,8 @@ protected: BarChartModel& mModel; QPen mPen; -// QList mBrushes; }; QTCOMMERCIALCHART_END_NAMESPACE -#endif // BARGROUPBASE_H +#endif // BARPRESENTERBASE_H diff --git a/src/barchart/percentbarpresenter.h b/src/barchart/percentbarpresenter.h index 040e53a..fa35af6 100644 --- a/src/barchart/percentbarpresenter.h +++ b/src/barchart/percentbarpresenter.h @@ -1,5 +1,5 @@ -#ifndef PERCENTBARGROUP_H -#define PERCENTBARGROUP_H +#ifndef PERCENTBARPRESENTER_H +#define PERCENTBARPRESENTER_H #include "chartitem_p.h" #include "bar_p.h" @@ -25,4 +25,4 @@ private: QTCOMMERCIALCHART_END_NAMESPACE -#endif // PERCENTBARGROUP_H +#endif // PERCENTBARPRESENTER_H diff --git a/src/barchart/qbarchartseries.h b/src/barchart/qbarchartseries.h index ebd19bd..118992b 100644 --- a/src/barchart/qbarchartseries.h +++ b/src/barchart/qbarchartseries.h @@ -9,7 +9,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class QBarCategory; class QBarSet; -class BarPresenter; class BarChartModel; // Container for series @@ -46,9 +45,7 @@ public Q_SLOTS: private: - BarPresenter* mBarGroup; BarChartModel* mModel; - }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/barchart/qpercentbarchartseries.h b/src/barchart/qpercentbarchartseries.h index 52c14fa..c5514d1 100644 --- a/src/barchart/qpercentbarchartseries.h +++ b/src/barchart/qpercentbarchartseries.h @@ -7,7 +7,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class PercentBarPresenter; class QBarCategory; class QBarSet; class BarChartModel; @@ -47,7 +46,6 @@ public Q_SLOTS: private: - PercentBarPresenter* mPercentBarGroup; BarChartModel* mModel; }; diff --git a/src/barchart/qstackedbarchartseries.h b/src/barchart/qstackedbarchartseries.h index 823b3b4..925b047 100644 --- a/src/barchart/qstackedbarchartseries.h +++ b/src/barchart/qstackedbarchartseries.h @@ -7,7 +7,6 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class StackedBarPresenter; class QBarCategory; class QBarSet; class BarChartModel; @@ -46,7 +45,6 @@ public Q_SLOTS: private: - StackedBarPresenter* mStackedBarGroup; BarChartModel* mModel; }; diff --git a/src/src.pro b/src/src.pro index da952a2..aed8aa6 100644 --- a/src/src.pro +++ b/src/src.pro @@ -38,6 +38,10 @@ PRIVATE_HEADERS += linechart/linechartitem_p.h \ barchart/bar_p.h \ barchart/separator_p.h \ barchart/barchartmodel_p.h \ + barchart/barpresenter.h \ + barchart/stackedbarpresenter.h \ + barchart/percentbarpresenter.h \ + barchart/barpresenterbase.h \ axisitem_p.h \ chartitem_p.h \ charttheme_p.h \ @@ -46,12 +50,8 @@ PRIVATE_HEADERS += linechart/linechartitem_p.h \ domain_p.h PUBLIC_HEADERS += linechart/qlinechartseries.h \ barchart/qbarchartseries.h \ - barchart/barpresenter.h \ barchart/qstackedbarchartseries.h \ - barchart/stackedbarpresenter.h \ barchart/qpercentbarchartseries.h \ - barchart/percentbarpresenter.h \ - barchart/barpresenterbase.h \ barchart/qbarset.h \ barchart/qbarcategory.h \ qchartseries.h \