summaryrefslogtreecommitdiffstats
path: root/examples/bars/graphmodifier.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-11-25 12:19:18 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-11-25 14:22:32 +0200
commite029d0ea1d486dd3dbbfa4519a2125da202f22e4 (patch)
treefc9f87f637a9adcca5a555355d96717d43eddc77 /examples/bars/graphmodifier.cpp
parente7e01ec065d3874d28e9e28d213783c4275d8813 (diff)
Change qreals to floats
+ Fix default axes to sensible + Fix some rounding errors in surface creation Task-number: QTRD-2622 Change-Id: I44450efc1e77ac8d8dbefc75814345949b8fb1f1 Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'examples/bars/graphmodifier.cpp')
-rw-r--r--examples/bars/graphmodifier.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/examples/bars/graphmodifier.cpp b/examples/bars/graphmodifier.cpp
index f38d88e9..8d9c9e88 100644
--- a/examples/bars/graphmodifier.cpp
+++ b/examples/bars/graphmodifier.cpp
@@ -34,13 +34,13 @@ const QString celsiusString = QString(QChar(0xB0)) + "C";
//! [0]
GraphModifier::GraphModifier(Q3DBars *bargraph)
: m_graph(bargraph),
- m_xRotation(0.0),
- m_yRotation(0.0),
+ m_xRotation(0.0f),
+ m_yRotation(0.0f),
m_fontSize(30),
m_segments(4),
m_subSegments(3),
- m_minval(-20.0),
- m_maxval(20.0),
+ m_minval(-20.0f),
+ m_maxval(20.0f),
//! [1]
m_temperatureAxis(new Q3DValueAxis),
m_yearAxis(new Q3DCategoryAxis),
@@ -110,24 +110,24 @@ void GraphModifier::resetTemperatureData()
{
//! [5]
// Set up data
- static const qreal tempOulu[7][12] = {
- {-6.7, -11.7, -9.7, 3.3, 9.2, 14.0, 16.3, 17.8, 10.2, 2.1, -2.6, -0.3}, // 2006
- {-6.8, -13.3, 0.2, 1.5, 7.9, 13.4, 16.1, 15.5, 8.2, 5.4, -2.6, -0.8}, // 2007
- {-4.2, -4.0, -4.6, 1.9, 7.3, 12.5, 15.0, 12.8, 7.6, 5.1, -0.9, -1.3}, // 2008
- {-7.8, -8.8, -4.2, 0.7, 9.3, 13.2, 15.8, 15.5, 11.2, 0.6, 0.7, -8.4}, // 2009
- {-14.4, -12.1, -7.0, 2.3, 11.0, 12.6, 18.8, 13.8, 9.4, 3.9, -5.6, -13.0}, // 2010
- {-9.0, -15.2, -3.8, 2.6, 8.3, 15.9, 18.6, 14.9, 11.1, 5.3, 1.8, -0.2}, // 2011
- {-8.7, -11.3, -2.3, 0.4, 7.5, 12.2, 16.4, 14.1, 9.2, 3.1, 0.3, -12.1} // 2012
+ static const float tempOulu[7][12] = {
+ {-6.7f, -11.7f, -9.7f, 3.3f, 9.2f, 14.0f, 16.3f, 17.8f, 10.2f, 2.1f, -2.6f, -0.3f}, // 2006
+ {-6.8f, -13.3f, 0.2f, 1.5f, 7.9f, 13.4f, 16.1f, 15.5f, 8.2f, 5.4f, -2.6f, -0.8f}, // 2007
+ {-4.2f, -4.0f, -4.6f, 1.9f, 7.3f, 12.5f, 15.0f, 12.8f, 7.6f, 5.1f, -0.9f, -1.3f}, // 2008
+ {-7.8f, -8.8f, -4.2f, 0.7f, 9.3f, 13.2f, 15.8f, 15.5f, 11.2f, 0.6f, 0.7f, -8.4f}, // 2009
+ {-14.4f, -12.1f, -7.0f, 2.3f, 11.0f, 12.6f, 18.8f, 13.8f, 9.4f, 3.9f, -5.6f, -13.0f}, // 2010
+ {-9.0f, -15.2f, -3.8f, 2.6f, 8.3f, 15.9f, 18.6f, 14.9f, 11.1f, 5.3f, 1.8f, -0.2f}, // 2011
+ {-8.7f, -11.3f, -2.3f, 0.4f, 7.5f, 12.2f, 16.4f, 14.1f, 9.2f, 3.1f, 0.3f, -12.1f} // 2012
};
- static const qreal tempHelsinki[7][12] = {
- {-3.7, -7.8, -5.4, 3.4, 10.7, 15.4, 18.6, 18.7, 14.3, 8.5, 2.9, 4.1}, // 2006
- {-1.2, -7.5, 3.1, 5.5, 10.3, 15.9, 17.4, 17.9, 11.2, 7.3, 1.1, 0.5}, // 2007
- {-0.6, 1.2, 0.2, 6.3, 10.2, 13.8, 18.1, 15.1, 10.1, 9.4, 2.5, 0.4}, // 2008
- {-2.9, -3.5, -0.9, 4.7, 10.9, 14.0, 17.4, 16.8, 13.2, 4.1, 2.6, -2.3}, // 2009
- {-10.2, -8.0, -1.9, 6.6, 11.3, 14.5, 21.0, 18.8, 12.6, 6.1, -0.5, -7.3}, // 2010
- {-4.4, -9.1, -2.0, 5.5, 9.9, 15.6, 20.8, 17.8, 13.4, 8.9, 3.6, 1.5}, // 2011
- {-3.5, -3.2, -0.7, 4.0, 11.1, 13.4, 17.3, 15.8, 13.1, 6.4, 4.1, -5.1} // 2012
+ static const float tempHelsinki[7][12] = {
+ {-3.7f, -7.8f, -5.4f, 3.4f, 10.7f, 15.4f, 18.6f, 18.7f, 14.3f, 8.5f, 2.9f, 4.1f}, // 2006
+ {-1.2f, -7.5f, 3.1f, 5.5f, 10.3f, 15.9f, 17.4f, 17.9f, 11.2f, 7.3f, 1.1f, 0.5f}, // 2007
+ {-0.6f, 1.2f, 0.2f, 6.3f, 10.2f, 13.8f, 18.1f, 15.1f, 10.1f, 9.4f, 2.5f, 0.4f}, // 2008
+ {-2.9f, -3.5f, -0.9f, 4.7f, 10.9f, 14.0f, 17.4f, 16.8f, 13.2f, 4.1f, 2.6f, -2.3f}, // 2009
+ {-10.2f, -8.0f, -1.9f, 6.6f, 11.3f, 14.5f, 21.0f, 18.8f, 12.6f, 6.1f, -0.5f, -7.3f}, // 2010
+ {-4.4f, -9.1f, -2.0f, 5.5f, 9.9f, 15.6f, 20.8f, 17.8f, 13.4f, 8.9f, 3.6f, 1.5f}, // 2011
+ {-3.5f, -3.2f, -0.7f, 4.0f, 11.1f, 13.4f, 17.3f, 15.8f, 13.1f, 6.4f, 4.1f, -5.1f} // 2012
};
// Create data arrays
@@ -260,10 +260,10 @@ void GraphModifier::setSeriesVisibility(int enabled)
{
m_graph->seriesList().at(1)->setVisible(bool(enabled));
if (enabled) {
- m_graph->setBarThickness(2.0);
+ m_graph->setBarThickness(2.0f);
m_graph->setBarSpacing(QSizeF(1.0, 3.0));
} else {
- m_graph->setBarThickness(1.0);
+ m_graph->setBarThickness(1.0f);
m_graph->setBarSpacing(QSizeF(1.0, 1.0));
}
}