summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-05-20 08:30:53 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-05-20 09:02:39 +0300
commit97e3308019b560e062e291f1f53034b4ab4bf85d (patch)
tree8280197dd6658e4ac25fd618d4d20cb044ca70ad /examples
parentb449ccd00f147aae2487d06d5c4e728d3a9b85db (diff)
Background lighting fix
Example tweaks. Default label transparanecy changed. Change-Id: Icfe198152a0c0ad74638651e486018be06dbbf0b Change-Id: Icfe198152a0c0ad74638651e486018be06dbbf0b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/barchart/main.cpp2
-rw-r--r--examples/mapdata/mapdata.cpp16
-rw-r--r--examples/rainfall/main.cpp12
-rw-r--r--examples/widget/chart.cpp7
4 files changed, 16 insertions, 21 deletions
diff --git a/examples/barchart/main.cpp b/examples/barchart/main.cpp
index 5c2e1c1c..f2862bfd 100644
--- a/examples/barchart/main.cpp
+++ b/examples/barchart/main.cpp
@@ -112,8 +112,6 @@ ChartDataGenerator::ChartDataGenerator(Q3DBars *barchart)
#ifndef CYCLE_THROUGH_THEMES
// Set bar colors
m_chart->setBarColor(QColor(Qt::gray), QColor(Qt::red), QColor(Qt::darkBlue));
- //m_chart->setTheme(ThemeSystem);
- m_chart->setLabelTransparency(TransparencyFromTheme);
#else
m_chart->setLabelTransparency(TransparencyNone);
#endif
diff --git a/examples/mapdata/mapdata.cpp b/examples/mapdata/mapdata.cpp
index 29620aa5..7ce9fb03 100644
--- a/examples/mapdata/mapdata.cpp
+++ b/examples/mapdata/mapdata.cpp
@@ -240,24 +240,14 @@ void MapsModifier::changeTheme()
theme = ThemeSystem;
}
-//void MapsModifier::changeSelectionMode()
-//{
-// static int selectionMode = 0;
-
-// m_chart->setSelectionMode((SelectionMode)selectionMode);
-
-// if (++selectionMode > (int)ModeZoomColumn)
-// selectionMode = 0;
-//}
-
void MapsModifier::changeTransparency()
{
- static int transparency = TransparencyFromTheme;
+ static int transparency = TransparencyNone;
m_chart->setLabelTransparency((LabelTransparency)transparency);
if (++transparency > TransparencyNoBackground)
- transparency = TransparencyNone;
+ transparency = TransparencyFromTheme;
}
void MapsModifier::changeValueDimension(int dimension)
@@ -269,7 +259,7 @@ void MapsModifier::changeFont(const QFont &font)
{
QFont newFont = font;
newFont.setPointSizeF(m_fontSize);
- qDebug() << newFont << newFont.style();
+ //qDebug() << newFont << newFont.style();
m_chart->setFont(newFont);
}
diff --git a/examples/rainfall/main.cpp b/examples/rainfall/main.cpp
index 44d9d172..47acee0b 100644
--- a/examples/rainfall/main.cpp
+++ b/examples/rainfall/main.cpp
@@ -42,8 +42,8 @@
#include "qdataitem.h"
#include <QGuiApplication>
-#include <QTimer>
-#include <QDebug>
+#include <QFont>
+//#include <QDebug>
using namespace QtDataVis3D;
@@ -79,6 +79,12 @@ RainfallChart::RainfallChart(Q3DBars *rainfall)
// Set bar type to cylinder
m_chart->setBarType(Cylinders, false);
+ // Set shadows to medium
+ m_chart->setShadowQuality(ShadowMedium);
+
+ // Set font
+ m_chart->setFont(QFont("Century Gothic", 40));
+
// Set selection mode to bar and column
//m_chart->setSelectionMode(ModeBarAndColumn);
m_chart->setSelectionMode(ModeZoomColumn);
@@ -87,7 +93,7 @@ RainfallChart::RainfallChart(Q3DBars *rainfall)
m_chart->setTheme(ThemeBlueNcs);
// Set preset camera position
- m_chart->setCameraPreset(PresetFront);
+ m_chart->setCameraPreset(PresetIsometricRightHigh);
// Disable grid
m_chart->setGridEnabled(false);
diff --git a/examples/widget/chart.cpp b/examples/widget/chart.cpp
index 741b04c7..8eff7a04 100644
--- a/examples/widget/chart.cpp
+++ b/examples/widget/chart.cpp
@@ -215,12 +215,12 @@ void ChartModifier::changeTheme()
void ChartModifier::changeTransparency()
{
- static int transparency = TransparencyFromTheme;
+ static int transparency = TransparencyNone;
m_chart->setLabelTransparency((LabelTransparency)transparency);
if (++transparency > TransparencyNoBackground)
- transparency = TransparencyNone;
+ transparency = TransparencyFromTheme;
}
void ChartModifier::changeSelectionMode()
@@ -236,7 +236,8 @@ void ChartModifier::changeSelectionMode()
void ChartModifier::changeFont(const QFont &font)
{
QFont newFont = font;
- newFont.setPixelSize(m_fontSize);
+ newFont.setPointSize(m_fontSize);
+ //qDebug() << newFont << newFont.style();
m_chart->setFont(newFont);
}