summaryrefslogtreecommitdiffstats
path: root/tests/scattertest/scatterchart.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-07 10:46:26 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-01-07 13:18:41 +0200
commit8566d712a87d9e3a78be15b6bd3498c2cf8afe57 (patch)
tree6ae292f0fd8c870d997db6d208a531da5f9320f0 /tests/scattertest/scatterchart.cpp
parentaa842c39480aa5b95f704c97b8b3acc821144883 (diff)
Fix setting theme type
Now reset the theme properties immediately to new theme type, instead of waiting for the theme activation. Also make changing theme type later work consistently. Task-number: QTRD-2750 Change-Id: I970d69587623119df33ad2a825fbc12367804eae Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'tests/scattertest/scatterchart.cpp')
-rw-r--r--tests/scattertest/scatterchart.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/scattertest/scatterchart.cpp b/tests/scattertest/scatterchart.cpp
index 10f48465..2277ca3f 100644
--- a/tests/scattertest/scatterchart.cpp
+++ b/tests/scattertest/scatterchart.cpp
@@ -37,7 +37,7 @@ ScatterDataModifier::ScatterDataModifier(Q3DScatter *scatter)
m_selectedItem(-1),
m_targetSeries(0)
{
- m_chart->setActiveTheme(new Q3DTheme(Q3DTheme::ThemeStoneMoss));
+ m_chart->activeTheme()->setType(Q3DTheme::ThemeStoneMoss);
QFont font = m_chart->activeTheme()->font();
font.setPointSize(m_fontSize);
m_chart->activeTheme()->setFont(font);
@@ -161,10 +161,7 @@ void ScatterDataModifier::changeTheme()
{
static int theme = Q3DTheme::ThemeQt;
- Q3DTheme *currentTheme = m_chart->activeTheme();
- m_chart->releaseTheme(currentTheme);
- delete currentTheme;
- m_chart->setActiveTheme(new Q3DTheme(Q3DTheme::Theme(theme)));
+ m_chart->activeTheme()->setType(Q3DTheme::Theme(theme));
if (++theme > Q3DTheme::ThemeIsabelle)
theme = Q3DTheme::ThemeQt;