summaryrefslogtreecommitdiffstats
path: root/examples/bars/graphmodifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bars/graphmodifier.cpp')
-rw-r--r--examples/bars/graphmodifier.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/examples/bars/graphmodifier.cpp b/examples/bars/graphmodifier.cpp
index 09fec65d..fddc385e 100644
--- a/examples/bars/graphmodifier.cpp
+++ b/examples/bars/graphmodifier.cpp
@@ -186,10 +186,7 @@ void GraphModifier::changePresetCamera()
void GraphModifier::changeTheme(int theme)
{
Q3DTheme *currentTheme = m_graph->activeTheme();
- m_graph->releaseTheme(currentTheme);
- delete currentTheme;
- currentTheme = new Q3DTheme(Q3DTheme::Theme(theme));
- m_graph->setActiveTheme(currentTheme);
+ currentTheme->setType(Q3DTheme::Theme(theme));
emit backgroundEnabledChanged(currentTheme->isBackgroundEnabled());
emit gridEnabledChanged(currentTheme->isGridEnabled());
emit fontChanged(currentTheme->font());