diff options
author | Sami Varanka <sami.varanka@qt.io> | 2021-09-23 08:52:53 +0300 |
---|---|---|
committer | Sami Varanka <sami.varanka@qt.io> | 2021-09-24 12:47:37 +0300 |
commit | 333cf897359eab1eb37e1f60dd681b00e6a5d135 (patch) | |
tree | 919e7e4233b57d2d3932e7b9a1e08d2aeab8f62f /tests/auto/cpptest/q3dsurface | |
parent | 5502d8116ff10e755ac562aebcf00d292f9a11a4 (diff) |
Add hasSeries method to Abstract3D graph
Added a hasSeries method to Abstract3Dgraph.
The method can be used to check whether a series
has already been added to the graph. In addition,
modified cpp and qml autotests to test
the added method.
Fixes: QTBUG-96683
Change-Id: I91f70ca15b6c5fbaa7691cd17bbfc2ef460c3d37
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests/auto/cpptest/q3dsurface')
-rw-r--r-- | tests/auto/cpptest/q3dsurface/tst_surface.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/cpptest/q3dsurface/tst_surface.cpp b/tests/auto/cpptest/q3dsurface/tst_surface.cpp index e0add57c..fc1068e3 100644 --- a/tests/auto/cpptest/q3dsurface/tst_surface.cpp +++ b/tests/auto/cpptest/q3dsurface/tst_surface.cpp @@ -54,6 +54,7 @@ private slots: void selectSeries(); void removeSeries(); void removeMultipleSeries(); + void hasSeries(); private: Q3DSurface *m_graph; @@ -263,5 +264,14 @@ void tst_surface::removeMultipleSeries() delete series3; } +void tst_surface::hasSeries() +{ + QSurface3DSeries *series1 = newSeries(); + m_graph->addSeries(series1); + QCOMPARE(m_graph->hasSeries(series1), true); + QSurface3DSeries *series2 = newSeries(); + QCOMPARE(m_graph->hasSeries(series2), false); +} + QTEST_MAIN(tst_surface) #include "tst_surface.moc" |