diff options
Diffstat (limited to 'examples/surface')
-rw-r--r-- | examples/surface/doc/src/surface.qdoc | 3 | ||||
-rw-r--r-- | examples/surface/surfacegraph.cpp | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/examples/surface/doc/src/surface.qdoc b/examples/surface/doc/src/surface.qdoc index dd334d01..d34c075e 100644 --- a/examples/surface/doc/src/surface.qdoc +++ b/examples/surface/doc/src/surface.qdoc @@ -124,7 +124,8 @@ Q3DSurface supports all the themes Qt Data Visualization has. The example has a pull down menu for selecting the theme. The following method is connected to the - menu to activate the selected theme. The old theme is released and deleted: + menu to activate the selected theme. The theme type is changed to another predefined theme, + which overwrites all theme properties to predefined values: \snippet ../examples/surface/surfacegraph.cpp 6 diff --git a/examples/surface/surfacegraph.cpp b/examples/surface/surfacegraph.cpp index 3770906e..a3d2b60e 100644 --- a/examples/surface/surfacegraph.cpp +++ b/examples/surface/surfacegraph.cpp @@ -229,10 +229,7 @@ void SurfaceGraph::setAxisZRange(float min, float max) //! [6] void SurfaceGraph::changeTheme(int theme) { - Q3DTheme *currentTheme = m_graph->activeTheme(); - m_graph->releaseTheme(currentTheme); - delete currentTheme; - m_graph->setActiveTheme(new Q3DTheme(Q3DTheme::Theme(theme))); + m_graph->activeTheme()->setType(Q3DTheme::Theme(theme)); } //! [6] |