diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2024-05-13 12:39:59 +0300 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2024-05-14 08:15:58 +0300 |
commit | 3520a9eea771166005c3d7907df71350f1063edd (patch) | |
tree | c79ae8f55c25035e1e3f0321f184aa9b423d0841 | |
parent | d3ef41c92c6be6b07fba798eada138cce2f9e9b5 (diff) |
Fix examples and manual tests for background toggling
The naming of window/background/plotAreaBackground
created a couple of wrong behaviors in the examples.
Change-Id: I9932962e2567823ec72178ab2f5d4a70251ea299
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io>
7 files changed, 13 insertions, 13 deletions
diff --git a/examples/graphs/3d/scatter/qml/scatter/main.qml b/examples/graphs/3d/scatter/qml/scatter/main.qml index 6af51d8..f5807d1 100644 --- a/examples/graphs/3d/scatter/qml/scatter/main.qml +++ b/examples/graphs/3d/scatter/qml/scatter/main.qml @@ -138,8 +138,8 @@ Item { source: graph.theme.backgroundEnabled ? "qrc:/images/background_hide.svg" : "qrc:/images/background.svg" onClicked: { - graph.theme.backgroundEnabled = !graph.theme.backgroundEnabled - text = graph.theme.backgroundEnabled ? qsTr("Hide Background") : qsTr("Show Background") + graph.theme.plotAreaBackgroundEnabled = !graph.theme.plotAreaBackgroundEnabled + text = graph.theme.plotAreaBackgroundEnabled ? qsTr("Hide Graph Background") : qsTr("Show Graph Background") } } } @@ -162,7 +162,7 @@ Item { source: "qrc:/images/theme.svg" onClicked: { graph.theme = graph.theme.theme === GraphsTheme.Theme.QtGreenNeon ? themeQt : themeQtNeonGreen - backgroundButton.text = graph.theme.backgroundEnabled ? qsTr("Hide Background") : qsTr("Show Background") + backgroundButton.text = graph.theme.plotAreaBackgroundEnabled ? qsTr("Hide Graph Background") : qsTr("Show Graph Background") } } } diff --git a/examples/graphs/3d/widgetgraphgallery/bargraph.cpp b/examples/graphs/3d/widgetgraphgallery/bargraph.cpp index 7935e91..a242956 100644 --- a/examples/graphs/3d/widgetgraphgallery/bargraph.cpp +++ b/examples/graphs/3d/widgetgraphgallery/bargraph.cpp @@ -118,7 +118,7 @@ void BarGraph::initialize() selectionModeList->setCurrentIndex(1); auto *backgroundCheckBox = new QCheckBox(m_barsWidget); - backgroundCheckBox->setText(u"Show background"_s); + backgroundCheckBox->setText(u"Show graph background"_s); backgroundCheckBox->setChecked(false); auto *gridCheckBox = new QCheckBox(m_barsWidget); diff --git a/examples/graphs/3d/widgetgraphgallery/graphmodifier.cpp b/examples/graphs/3d/widgetgraphgallery/graphmodifier.cpp index 97a0c57..47c8a03 100644 --- a/examples/graphs/3d/widgetgraphgallery/graphmodifier.cpp +++ b/examples/graphs/3d/widgetgraphgallery/graphmodifier.cpp @@ -34,7 +34,7 @@ GraphModifier::GraphModifier(Q3DBars *bargraph, QObject *parent) { //! [2] m_graph->setShadowQuality(QAbstract3DGraph::ShadowQuality::SoftMedium); - m_graph->activeTheme()->setBackgroundEnabled(false); + m_graph->activeTheme()->setPlotAreaBackgroundEnabled(false); m_graph->activeTheme()->setLabelFont(QFont("Times New Roman", m_fontSize)); m_graph->activeTheme()->setLabelBackgroundEnabled(true); m_graph->setMultiSeriesUniform(true); @@ -240,7 +240,7 @@ void GraphModifier::changeTheme(int theme) { QGraphsTheme *currentTheme = m_graph->activeTheme(); currentTheme->setTheme(QGraphsTheme::Theme(theme)); - emit backgroundEnabledChanged(currentTheme->isBackgroundEnabled()); + emit backgroundEnabledChanged(currentTheme->isPlotAreaBackgroundEnabled()); emit gridEnabledChanged(currentTheme->isGridEnabled()); emit fontChanged(currentTheme->labelFont()); emit fontSizeChanged(currentTheme->labelFont().pointSize()); @@ -404,7 +404,7 @@ void GraphModifier::rotateY(int rotation) void GraphModifier::setBackgroundEnabled(int enabled) { - m_graph->activeTheme()->setBackgroundEnabled(bool(enabled)); + m_graph->activeTheme()->setPlotAreaBackgroundEnabled(bool(enabled)); } void GraphModifier::setGridEnabled(int enabled) diff --git a/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.cpp b/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.cpp index 65456ae..554cd64 100644 --- a/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.cpp +++ b/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.cpp @@ -117,7 +117,7 @@ void ScatterDataModifier::changeTheme(int theme) { QGraphsTheme *currentTheme = m_graph->activeTheme(); currentTheme->setTheme(QGraphsTheme::Theme(theme)); - emit backgroundEnabledChanged(currentTheme->isBackgroundEnabled()); + emit backgroundEnabledChanged(currentTheme->isPlotAreaBackgroundEnabled()); emit gridEnabledChanged(currentTheme->isGridEnabled()); } @@ -217,7 +217,7 @@ void ScatterDataModifier::changeShadowQuality(int quality) void ScatterDataModifier::setBackgroundEnabled(int enabled) { - m_graph->activeTheme()->setBackgroundEnabled((bool) enabled); + m_graph->activeTheme()->setPlotAreaBackgroundEnabled((bool) enabled); } void ScatterDataModifier::setGridEnabled(int enabled) diff --git a/examples/graphs/3d/widgetgraphgallery/scattergraph.cpp b/examples/graphs/3d/widgetgraphgallery/scattergraph.cpp index 136fce5..2c88106 100644 --- a/examples/graphs/3d/widgetgraphgallery/scattergraph.cpp +++ b/examples/graphs/3d/widgetgraphgallery/scattergraph.cpp @@ -59,7 +59,7 @@ void ScatterGraph::initialize() rangeMaxSlider->setValue(10); auto *backgroundCheckBox = new QCheckBox(m_scatterWidget); - backgroundCheckBox->setText(u"Show background"_s); + backgroundCheckBox->setText(u"Show graph background"_s); backgroundCheckBox->setChecked(true); auto *gridCheckBox = new QCheckBox(m_scatterWidget); diff --git a/examples/graphs/3d/widgetvolumetric/volumetric.cpp b/examples/graphs/3d/widgetvolumetric/volumetric.cpp index 87e9983..a8d65fd 100644 --- a/examples/graphs/3d/widgetvolumetric/volumetric.cpp +++ b/examples/graphs/3d/widgetvolumetric/volumetric.cpp @@ -39,7 +39,7 @@ VolumetricModifier::VolumetricModifier(Q3DScatter *scatter) //! [0] m_graph->setOrthoProjection(true); //! [0] - m_graph->activeTheme()->setBackgroundEnabled(false); + m_graph->activeTheme()->setPlotAreaBackgroundEnabled(false); // Only allow zooming at the center and limit the zoom to 200% to avoid clipping issues m_graph->setZoomAtTargetEnabled(false); diff --git a/tests/manual/directional/scatterdatamodifier.cpp b/tests/manual/directional/scatterdatamodifier.cpp index 2f256fa..8a09704 100644 --- a/tests/manual/directional/scatterdatamodifier.cpp +++ b/tests/manual/directional/scatterdatamodifier.cpp @@ -125,7 +125,7 @@ void ScatterDataModifier::changeTheme(int theme) { QGraphsTheme *currentTheme = m_graph->activeTheme(); currentTheme->setTheme(QGraphsTheme::Theme(theme)); - emit backgroundEnabledChanged(currentTheme->isBackgroundEnabled()); + emit backgroundEnabledChanged(currentTheme->isPlotAreaBackgroundEnabled()); emit gridEnabledChanged(currentTheme->isGridEnabled()); emit fontChanged(currentTheme->labelFont()); } @@ -184,7 +184,7 @@ void ScatterDataModifier::changeShadowQuality(int quality) void ScatterDataModifier::setBackgroundEnabled(int enabled) { - m_graph->activeTheme()->setBackgroundEnabled((bool)enabled); + m_graph->activeTheme()->setPlotAreaBackgroundEnabled((bool) enabled); } void ScatterDataModifier::setGridEnabled(int enabled) |