diff options
author | Sami Varanka <sami.varanka@qt.io> | 2021-06-29 18:57:12 +0300 |
---|---|---|
committer | Sami Varanka <sami.varanka@qt.io> | 2021-08-06 08:59:55 +0300 |
commit | 3513884f6838d31e72c462ee358293c2e797f04b (patch) | |
tree | bc6ffd9c469d8bb55e228fa80ed9f8a8b8bdb9fd /tests | |
parent | 4b9fc0883ac6955089b3d552227cba1a8cea6087 (diff) |
Add: Colorize surfaceseries wireframe
Added color property for surfaceseries wireframe.
Modified surfaceseries cpptest and qmltest to
test the added property. In addition,
the documentation for the property was added.
Modified qmlsurface example to use the new
property.
Fixes: QTBUG-64748
Change-Id: I18f56258cdba2b3270dce7c8313cbf17e499ff39
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cpptest/q3dsurface-series/tst_series.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qmltest/surface3d/tst_surfaceseries.qml | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp b/tests/auto/cpptest/q3dsurface-series/tst_series.cpp index 23f86dd5..9a097d6e 100644 --- a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp +++ b/tests/auto/cpptest/q3dsurface-series/tst_series.cpp @@ -92,7 +92,7 @@ void tst_series::initialProperties() QCOMPARE(m_series->isFlatShadingEnabled(), true); QCOMPARE(m_series->isFlatShadingSupported(), true); QCOMPARE(m_series->selectedPoint(), m_series->invalidSelectionPosition()); - + QCOMPARE(m_series->wireFrameColor(), QColor(Qt::black)); // Common properties. The ones identical between different series are tested in QBar3DSeries tests QCOMPARE(m_series->itemLabelFormat(), QString("@xLabel, @yLabel, @zLabel")); QCOMPARE(m_series->mesh(), QAbstract3DSeries::MeshSphere); @@ -107,10 +107,12 @@ void tst_series::initializeProperties() m_series->setDrawMode(QSurface3DSeries::DrawWireframe); m_series->setFlatShadingEnabled(false); m_series->setSelectedPoint(QPoint(0, 0)); + m_series->setWireFrameColor(QColor(Qt::red)); QCOMPARE(m_series->drawMode(), QSurface3DSeries::DrawWireframe); QCOMPARE(m_series->isFlatShadingEnabled(), false); QCOMPARE(m_series->selectedPoint(), QPoint(0, 0)); + QCOMPARE(m_series->wireFrameColor(), QColor(Qt::red)); // Common properties. The ones identical between different series are tested in QBar3DSeries tests m_series->setMesh(QAbstract3DSeries::MeshPyramid); diff --git a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml index a4593c94..0428ab53 100644 --- a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml +++ b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml @@ -79,6 +79,7 @@ Item { flatShadingEnabled: false selectedPoint: Qt.point(0, 0) textureFile: ":\customtexture.jpg" + wireFrameColor: "red" baseColor: "blue" baseGradient: gradient1 @@ -123,6 +124,7 @@ Item { compare(initial.flatShadingEnabled, true) compare(initial.flatShadingSupported, true) compare(initial.selectedPoint, Qt.point(-1, -1)) + compare(initial.wireFrameColor, "#000000") } function test_2_initial_common() { @@ -156,6 +158,7 @@ Item { compare(initialized.flatShadingEnabled, false) compare(initialized.selectedPoint, Qt.point(0, 0)) compare(initialized.textureFile, ":\customtexture.jpg") + compare(initialized.wireFrameColor, "#ff0000") } function test_2_initialized_common() { @@ -187,6 +190,7 @@ Item { change.flatShadingEnabled = false change.selectedPoint = Qt.point(0, 0) change.textureFile = ":\customtexture.jpg" + change.wireFrameColor = "green" } function test_2_test_change() { @@ -196,6 +200,7 @@ Item { compare(change.flatShadingEnabled, false) compare(change.selectedPoint, Qt.point(0, 0)) compare(change.textureFile, ":\customtexture.jpg") + compare(change.wireFrameColor, "#008000") } function test_3_change_common() { |