From 56fd46a395765db6818f890676e42cc59a9f4a81 2013-04-09 08:31:26 From: Miikka Heikkinen Date: 2013-04-09 08:31:26 Subject: [PATCH] Revert "Remove TODOs for 1.2.1 release, revert this after release" This reverts commit 9df61547fec62d7a608dd8cd2be94e04ed0f92e3. Release has been done, so bring back the TODOs. Change-Id: I1362a254a7f9c9c2f0b659b72af29638a980a394 Reviewed-by: Miikka Heikkinen --- diff --git a/src/animations/axisanimation.cpp b/src/animations/axisanimation.cpp index 3285130..e59d9aa 100644 --- a/src/animations/axisanimation.cpp +++ b/src/animations/axisanimation.cpp @@ -57,6 +57,11 @@ void AxisAnimation::setValues(QVector &oldLayout, QVector &newLayo { if (state() != QAbstractAnimation::Stopped) stop(); +// TODO: cannot return even if layout is empty +// New layout is not set properly without it (crash) +// if (newLayout.count() == 0) +// return; + switch (m_type) { case ZoomOutAnimation: { QRectF rect = m_axis->gridGeometry(); @@ -125,6 +130,7 @@ void AxisAnimation::updateCurrentValue(const QVariant &value) { if (state() != QAbstractAnimation::Stopped) { //workaround QVector vector = qvariant_cast >(value); +// Q_ASSERT(vector.count() != 0); m_axis->setLayout(vector); m_axis->updateGeometry(); } diff --git a/src/areachart/areachartitem.cpp b/src/areachart/areachartitem.cpp index 6ecf8c8..92f8999 100644 --- a/src/areachart/areachartitem.cpp +++ b/src/areachart/areachartitem.cpp @@ -31,6 +31,8 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE +//TODO: optimize : remove points which are not visible + AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item) : ChartItem(areaSeries->d_func(),item), m_series(areaSeries), diff --git a/src/axis/barcategoryaxis/qbarcategoryaxis.cpp b/src/axis/barcategoryaxis/qbarcategoryaxis.cpp index 47d4ab5..0dffff0 100644 --- a/src/axis/barcategoryaxis/qbarcategoryaxis.cpp +++ b/src/axis/barcategoryaxis/qbarcategoryaxis.cpp @@ -248,6 +248,7 @@ void QBarCategoryAxis::remove(const QString &category) setRange(d->m_minCategory, d->m_categories.last()); } else { d->updateCategoryDomain(); + //TODO:: d->emitUpdated(); } } else { setRange(QString::null, QString::null); @@ -281,6 +282,7 @@ void QBarCategoryAxis::insert(int index, const QString &category) setRange(d->m_minCategory, d->m_categories.last()); } else { d->updateCategoryDomain(); + //TODO:: d->emitUpdated(); } emit categoriesChanged(); @@ -304,6 +306,8 @@ void QBarCategoryAxis::replace(const QString &oldCategory, const QString &newCat setRange(newCategory, d->m_maxCategory); } else if (d->m_maxCategory == oldCategory) { setRange(d->m_minCategory, newCategory); + } else { + //TODO:: d->emitUpdated(); } emit categoriesChanged(); emit countChanged(); diff --git a/src/axis/categoryaxis/chartcategoryaxisx.cpp b/src/axis/categoryaxis/chartcategoryaxisx.cpp index b0d6651..9c9813c 100644 --- a/src/axis/categoryaxis/chartcategoryaxisx.cpp +++ b/src/axis/categoryaxis/chartcategoryaxisx.cpp @@ -67,6 +67,7 @@ QVector ChartCategoryAxisX::calculateLayout() const void ChartCategoryAxisX::updateGeometry() { + //TODO: this is not optimal when many categories :( , create only visible lables setLabels(m_axis->categoriesLabels() << ""); HorizontalAxis::updateGeometry(); } diff --git a/src/axis/categoryaxis/qcategoryaxis.cpp b/src/axis/categoryaxis/qcategoryaxis.cpp index 42a2ca4..40d8cc2 100644 --- a/src/axis/categoryaxis/qcategoryaxis.cpp +++ b/src/axis/categoryaxis/qcategoryaxis.cpp @@ -227,6 +227,7 @@ void QCategoryAxis::remove(const QString &categoryLabel) d->m_categoriesMap.insert(label, range); } } + //TODO:: d->emitUpdated(); } } @@ -250,6 +251,7 @@ void QCategoryAxis::replaceLabel(const QString &oldLabel, const QString &newLabe Range range = d->m_categoriesMap.value(oldLabel); d->m_categoriesMap.remove(oldLabel); d->m_categoriesMap.insert(newLabel, range); + //TODO:: d->emitUpdated(); } } diff --git a/src/axis/qabstractaxis.cpp b/src/axis/qabstractaxis.cpp index 5b7a796..60e071d 100644 --- a/src/axis/qabstractaxis.cpp +++ b/src/axis/qabstractaxis.cpp @@ -468,6 +468,7 @@ QPen QAbstractAxis::linePen() const return d_ptr->m_axisPen; } +//TODO: remove me 2.0 void QAbstractAxis::setLinePenColor(QColor color) { QPen p = d_ptr->m_axisPen; @@ -613,6 +614,7 @@ int QAbstractAxis::labelsAngle() const { return d_ptr->m_labelsAngle; } +//TODO: remove me 2.0 void QAbstractAxis::setLabelsColor(QColor color) { QBrush b = d_ptr->m_labelsBrush; @@ -861,6 +863,8 @@ void QAbstractAxis::setRange(const QVariant &min, const QVariant &max) /*! Returns the orientation in which the axis is being used (Vertical or Horizontal) */ +// NOTE: should have const but it breaks BC: +// http://techbase.kde.org/Policies/Binary_Compatibility_Examples#Change_the_CV-qualifiers_of_a_member_function Qt::Orientation QAbstractAxis::orientation() { return d_ptr->orientation(); @@ -922,6 +926,7 @@ void QAbstractAxisPrivate::initializeTheme(ChartTheme* theme, bool forced) bool axisX = m_orientation == Qt::Horizontal; + //TODO: introduce axis brush if (m_visible) { if (m_arrowVisible) { if (forced || pen == m_axisPen) { diff --git a/src/axis/qabstractaxis.h b/src/axis/qabstractaxis.h index 8b7f562..5ebd797 100644 --- a/src/axis/qabstractaxis.h +++ b/src/axis/qabstractaxis.h @@ -145,7 +145,7 @@ public: void setShadesBorderColor(QColor color); QColor shadesBorderColor() const; - Qt::Orientation orientation(); + Qt::Orientation orientation(); //TODO: missing const <- BC (2.0) Qt::Alignment alignment() const; //range handling diff --git a/src/axis/valueaxis/qvalueaxis.h b/src/axis/valueaxis/qvalueaxis.h index 69bd487..b87d5b2 100644 --- a/src/axis/valueaxis/qvalueaxis.h +++ b/src/axis/valueaxis/qvalueaxis.h @@ -60,6 +60,7 @@ public: void setLabelFormat(const QString &format); QString labelFormat() const; + //TODO: deprecated! (2.0) void setNiceNumbersEnabled(bool enable = true); bool niceNumbersEnabled() const; diff --git a/src/axis/valueaxis/qvalueaxis_p.h b/src/axis/valueaxis/qvalueaxis_p.h index 8cf68f1..ce6a6db 100644 --- a/src/axis/valueaxis/qvalueaxis_p.h +++ b/src/axis/valueaxis/qvalueaxis_p.h @@ -61,7 +61,7 @@ private: int m_tickCount; QString m_format; bool m_applying; - bool m_niceNumbersEnabled; + bool m_niceNumbersEnabled; //TODO: this deprecated (2.0) Q_DECLARE_PUBLIC(QValueAxis) }; diff --git a/src/chartpresenter_p.h b/src/chartpresenter_p.h index 64193f6..9f1c8b8 100644 --- a/src/chartpresenter_p.h +++ b/src/chartpresenter_p.h @@ -124,6 +124,7 @@ public: void startAnimation(ChartAnimation *animation); + //TODO refactor void setState(State state,QPointF point); State state() const { return m_state; } QPointF statePoint() const { return m_statePoint; } diff --git a/src/chartthememanager.cpp b/src/chartthememanager.cpp index e47cb12..0e4e4fa 100644 --- a/src/chartthememanager.cpp +++ b/src/chartthememanager.cpp @@ -183,6 +183,9 @@ QList ChartThemeManager::generateSeriesGradients(const QList& qreal h = color.hsvHueF(); qreal s = color.hsvSaturationF(); + // TODO: tune the algorithm to give nice results with most base colors defined in + // most themes. The rest of the gradients we can define manually in theme specific + // implementation. QColor start = color; start.setHsvF(h, 0.0, 1.0); g.setColorAt(0.0, start); diff --git a/src/legend/qlegendmarker_p.h b/src/legend/qlegendmarker_p.h index 7423616..d46c19c 100644 --- a/src/legend/qlegendmarker_p.h +++ b/src/legend/qlegendmarker_p.h @@ -39,6 +39,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE +// TODO: check these class QAbstractSeries; class QAreaSeries; class QXYSeries; diff --git a/src/qchart.cpp b/src/qchart.cpp index 496e146..8ab736e 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -447,6 +447,15 @@ QRectF QChart::plotArea() const return d_ptr->m_presenter->geometry(); } +///*! +// TODO: Dummy. +// Adjust the ranges of the axes so that all the data of the specified \a series is visible +// */ +//void QChart::adjustViewToSeries(QAbstractSeries* series) +//{ +// // +//} + /*! Sets animation \a options for the chart */ diff --git a/src/scatterchart/scatterchartitem.cpp b/src/scatterchart/scatterchartitem.cpp index fadd14a..93761ed 100644 --- a/src/scatterchart/scatterchartitem.cpp +++ b/src/scatterchart/scatterchartitem.cpp @@ -177,6 +177,7 @@ void ScatterChartItem::handleUpdated() setOpacity(m_series->opacity()); if (recreate) { + // TODO: optimize handleUpdate to recreate points only in case shape changed deletePoints(count); createPoints(count); diff --git a/src/xychart/xychart.cpp b/src/xychart/xychart.cpp index 3725bdb..ecadf67 100644 --- a/src/xychart/xychart.cpp +++ b/src/xychart/xychart.cpp @@ -30,6 +30,8 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE +//TODO: optimize : remove points which are not visible + XYChart::XYChart(QXYSeries *series,QGraphicsItem* item): ChartItem(series->d_func(),item), m_series(series),