diff options
author | Sami Varanka <sami.varanka@qt.io> | 2021-09-29 14:53:35 +0300 |
---|---|---|
committer | Sami Varanka <sami.varanka@qt.io> | 2021-10-08 13:47:25 +0300 |
commit | 6d31e42632f0779212b2a265f3c9a7c97a0e63b0 (patch) | |
tree | aa59e7a7d845c8f5bb44f5690b8c08764975736a /tests/auto/cpptest/q3dbars-series/tst_series.cpp | |
parent | 9f9d5bc9d45ea99726cc23b5552cce19918771b9 (diff) |
Add row colors for Bar3DSeries
Added rowColors property for Bar3DSeries.
The property can be used draw the individual
rows in the series in different colors.
Autotests and a manualtest for the property were
added also.
Fixes: QTBUG-96682
Change-Id: I5c4f778189d079206500a9289490792584eab2b9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests/auto/cpptest/q3dbars-series/tst_series.cpp')
-rw-r--r-- | tests/auto/cpptest/q3dbars-series/tst_series.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/cpptest/q3dbars-series/tst_series.cpp b/tests/auto/cpptest/q3dbars-series/tst_series.cpp index 11dfd3f2..74e375c5 100644 --- a/tests/auto/cpptest/q3dbars-series/tst_series.cpp +++ b/tests/auto/cpptest/q3dbars-series/tst_series.cpp @@ -90,6 +90,7 @@ void tst_series::initialProperties() QVERIFY(m_series->dataProxy()); QCOMPARE(m_series->meshAngle(), 0.0f); QCOMPARE(m_series->selectedBar(), m_series->invalidSelectionPosition()); + QCOMPARE(m_series->rowColors().size(), 0); // Common properties QCOMPARE(m_series->baseColor(), QColor(Qt::black)); @@ -132,6 +133,13 @@ void tst_series::initializeProperties() gradient3.setColorAt(0.0, Qt::white); gradient3.setColorAt(1.0, Qt::gray); + QList<QColor> rowColors; + rowColors.append(QColor(Qt::green)); + rowColors.append(QColor(Qt::blue)); + rowColors.append(QColor(Qt::red)); + + m_series->setRowColors(rowColors); + // Common properties m_series->setBaseColor(QColor(Qt::blue)); m_series->setBaseGradient(gradient1); @@ -165,6 +173,11 @@ void tst_series::initializeProperties() QCOMPARE(m_series->singleHighlightGradient().stops().at(0).second, QColor(Qt::white)); QCOMPARE(m_series->userDefinedMesh(), QString(":/customitem.obj")); QCOMPARE(m_series->isVisible(), false); + + QCOMPARE(m_series->rowColors().size(), 3); + QCOMPARE(m_series->rowColors().at(0), QColor(Qt::green)); + QCOMPARE(m_series->rowColors().at(1), QColor(Qt::blue)); + QCOMPARE(m_series->rowColors().at(2), QColor(Qt::red)); } void tst_series::invalidProperties() |