mirror of https://github.com/qt/qtgraphs.git
Graphs: rename drawOrder property to zValue
Based on API review: the drawOrder property has been renamed to zValue for consistency within the Qt Graphics API. Pick-to: 6.10 Task-number: QTBUG-137478 Change-Id: I8b82a998ca2d5165169d3184c493708b3214f24a Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This commit is contained in:
parent
4b4a319047
commit
9a2b68a825
|
|
@ -203,21 +203,21 @@ QT_BEGIN_NAMESPACE
|
|||
*/
|
||||
|
||||
/*!
|
||||
\property QAbstractSeries::drawOrder
|
||||
\property QAbstractSeries::zValue
|
||||
\brief Controls the order in which the series is drawn
|
||||
\since 6.10
|
||||
|
||||
The series list of GraphsView is sorted by the drawOrder property. Since each series type is
|
||||
The series list of GraphsView is sorted by the zValue property. Since each series type is
|
||||
rendered at once, the order mostly works as an internal order of each series type. The highest
|
||||
drawOrder of each series type determines the order of rendering among series types. The default
|
||||
zValue of each series type determines the order of rendering among series types. The default
|
||||
value is 0.
|
||||
*/
|
||||
/*!
|
||||
\qmlproperty int AbstractSeries::drawOrder
|
||||
\qmlproperty int AbstractSeries::zValue
|
||||
\since 6.10
|
||||
The series list of GraphsView is sorted by the drawOrder property. Since each series type is
|
||||
The series list of GraphsView is sorted by the zValue property. Since each series type is
|
||||
rendered at once, the order mostly works as an internal order of each series type. The highest
|
||||
drawOrder of each series type determines the order of rendering among series types. The default
|
||||
zValue of each series type determines the order of rendering among series types. The default
|
||||
value is 0.
|
||||
*/
|
||||
|
||||
|
|
@ -528,20 +528,20 @@ void QAbstractSeries::setValuesMultiplier(qreal valuesMultiplier)
|
|||
}
|
||||
}
|
||||
|
||||
int QAbstractSeries::drawOrder() const
|
||||
int QAbstractSeries::zValue() const
|
||||
{
|
||||
Q_D(const QAbstractSeries);
|
||||
return d->m_drawOrder;
|
||||
}
|
||||
|
||||
void QAbstractSeries::setDrawOrder(int newDrawOrder)
|
||||
void QAbstractSeries::setZValue(int newDrawOrder)
|
||||
{
|
||||
Q_D(QAbstractSeries);
|
||||
if (d->m_drawOrder == newDrawOrder)
|
||||
return;
|
||||
d->m_drawOrder = newDrawOrder;
|
||||
update();
|
||||
emit drawOrderChanged(newDrawOrder);
|
||||
emit zValueChanged(newDrawOrder);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Q_GRAPHS_EXPORT QAbstractSeries : public QObject, public QQmlParserStatus
|
|||
Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged REVISION(6, 10))
|
||||
Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION(6, 10))
|
||||
Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION(6, 10))
|
||||
Q_PROPERTY(int drawOrder READ drawOrder WRITE setDrawOrder NOTIFY drawOrderChanged REVISION(6, 10))
|
||||
Q_PROPERTY(int zValue READ zValue WRITE setZValue NOTIFY zValueChanged REVISION(6, 10))
|
||||
Q_CLASSINFO("DefaultProperty", "seriesChildren")
|
||||
QML_ANONYMOUS
|
||||
|
||||
|
|
@ -115,8 +115,8 @@ public:
|
|||
QAbstractAxis *axisY() const;
|
||||
void setAxisY(QAbstractAxis *newAxisY);
|
||||
|
||||
int drawOrder() const;
|
||||
void setDrawOrder(int newDrawOrder);
|
||||
int zValue() const;
|
||||
void setZValue(int newDrawOrder);
|
||||
|
||||
Q_SIGNALS:
|
||||
void update();
|
||||
|
|
@ -134,8 +134,7 @@ Q_SIGNALS:
|
|||
|
||||
Q_REVISION(6, 10) void axisXChanged(QAbstractAxis *newAxis);
|
||||
Q_REVISION(6, 10) void axisYChanged(QAbstractAxis *newAxis);
|
||||
|
||||
Q_REVISION(6, 10) void drawOrderChanged(int newDrawOrder);
|
||||
Q_REVISION(6, 10) void zValueChanged(int z);
|
||||
|
||||
protected:
|
||||
friend class BarsRenderer;
|
||||
|
|
|
|||
|
|
@ -861,7 +861,7 @@ void QGraphsView::updatePolish()
|
|||
auto series2 = qobject_cast<QAbstractSeries *>(rhs);
|
||||
|
||||
if (series1 && series2)
|
||||
return series1->drawOrder() < series2->drawOrder();
|
||||
return series1->zValue() < series2->zValue();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -892,8 +892,8 @@ void QGraphsView::updatePolish()
|
|||
if (m_barsRenderer) {
|
||||
if (auto barSeries = qobject_cast<QBarSeries *>(series)) {
|
||||
m_barsRenderer->handlePolish(barSeries, barSeriesIndex, barSeriesCount);
|
||||
if (barSeries->drawOrder() > highestBarsZ)
|
||||
highestBarsZ = barSeries->drawOrder();
|
||||
if (barSeries->zValue() > highestBarsZ)
|
||||
highestBarsZ = barSeries->zValue();
|
||||
barSeriesIndex++;
|
||||
}
|
||||
}
|
||||
|
|
@ -904,24 +904,24 @@ void QGraphsView::updatePolish()
|
|||
#ifdef USE_LINEGRAPH
|
||||
if (auto lineSeries = qobject_cast<QLineSeries *>(series)) {
|
||||
m_pointRenderer->handlePolish(lineSeries);
|
||||
if (lineSeries->drawOrder() > highestPointZ)
|
||||
highestPointZ = lineSeries->drawOrder();
|
||||
if (lineSeries->zValue() > highestPointZ)
|
||||
highestPointZ = lineSeries->zValue();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SCATTERGRAPH
|
||||
if (auto scatterSeries = qobject_cast<QScatterSeries *>(series)) {
|
||||
m_pointRenderer->handlePolish(scatterSeries);
|
||||
if (scatterSeries->drawOrder() > highestPointZ)
|
||||
highestPointZ = scatterSeries->drawOrder();
|
||||
if (scatterSeries->zValue() > highestPointZ)
|
||||
highestPointZ = scatterSeries->zValue();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SPLINEGRAPH
|
||||
if (auto splineSeries = qobject_cast<QSplineSeries *>(series)) {
|
||||
m_pointRenderer->handlePolish(splineSeries);
|
||||
if (splineSeries->drawOrder() > highestPointZ)
|
||||
highestPointZ = splineSeries->drawOrder();
|
||||
if (splineSeries->zValue() > highestPointZ)
|
||||
highestPointZ = splineSeries->zValue();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -931,8 +931,8 @@ void QGraphsView::updatePolish()
|
|||
if (m_pieRenderer) {
|
||||
if (auto pieSeries = qobject_cast<QPieSeries *>(series)) {
|
||||
m_pieRenderer->handlePolish(pieSeries);
|
||||
if (pieSeries->drawOrder() > highestPieZ)
|
||||
highestPieZ = pieSeries->drawOrder();
|
||||
if (pieSeries->zValue() > highestPieZ)
|
||||
highestPieZ = pieSeries->zValue();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -941,8 +941,8 @@ void QGraphsView::updatePolish()
|
|||
if (m_areaRenderer) {
|
||||
if (auto areaSeries = qobject_cast<QAreaSeries *>(series)) {
|
||||
m_areaRenderer->handlePolish(areaSeries);
|
||||
if (areaSeries->drawOrder() > highestAreaZ)
|
||||
highestAreaZ = areaSeries->drawOrder();
|
||||
if (areaSeries->zValue() > highestAreaZ)
|
||||
highestAreaZ = areaSeries->zValue();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ void BarsRenderer::updateComponents(QBarSeries *series)
|
|||
auto &barItem = barItems[barIndex];
|
||||
barItem->setX(d.rect.x());
|
||||
barItem->setY(d.rect.y());
|
||||
barItem->setZ(series->drawOrder());
|
||||
barItem->setZ(series->zValue());
|
||||
barItem->setWidth(d.rect.width());
|
||||
barItem->setHeight(d.rect.height());
|
||||
barItem->setVisible(series->isVisible());
|
||||
|
|
@ -195,7 +195,7 @@ void BarsRenderer::updateComponents(QBarSeries *series)
|
|||
if (barItem) {
|
||||
barItem->setX(d.rect.x());
|
||||
barItem->setY(d.rect.y());
|
||||
barItem->setZ(series->drawOrder());
|
||||
barItem->setZ(series->zValue());
|
||||
barItem->setWidth(d.rect.width());
|
||||
barItem->setHeight(d.rect.height());
|
||||
barItem->setVisible(series->isVisible());
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ void PointRenderer::handlePolish(QXYSeries *series)
|
|||
}
|
||||
|
||||
for (auto &&marker : group->markers)
|
||||
marker->setZ(group->series->drawOrder());
|
||||
marker->setZ(group->series->zValue());
|
||||
|
||||
if (group->colorIndex < 0) {
|
||||
group->colorIndex = m_graph->graphSeriesCount();
|
||||
|
|
|
|||
Loading…
Reference in New Issue