summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-12-10 12:55:22 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-12-10 13:34:29 +0200
commit56eb5442dd1e2d6233e443bab956c6bd1b7a116b (patch)
treef787dd58af4219c4d51b1131e26b14271924fa62 /tests
parent6e35dbbfc272b322d9e39d30dec3039a75a149fa (diff)
Multiseries support for theme colors and gradients, Part 1
Task-number: QTRD-2611 - declarative support for color list missing - declarative connections and fixes for count etc. Change-Id: I0ac007dcd7acb011d1a4461a56066ee41c364a75 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/barstest/chart.cpp12
-rw-r--r--tests/multigraphs/data.cpp7
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/barstest/chart.cpp b/tests/barstest/chart.cpp
index 97685074..f4ccf83e 100644
--- a/tests/barstest/chart.cpp
+++ b/tests/barstest/chart.cpp
@@ -736,7 +736,9 @@ void GraphModifier::useOwnTheme()
theme->setGridEnabled(true);
theme->setAmbientLightStrength(0.3f);
theme->setBackgroundColor(QColor(QRgb(0x99ca53)));
- theme->setBaseColor(QColor(QRgb(0x209fdf)));
+ QList<QColor> colors;
+ colors.append(QColor(QRgb(0x209fdf)));
+ theme->setBaseColors(colors);
theme->setColorStyle(Q3DTheme::ColorStyleUniform);
theme->setGridLineColor(QColor(QRgb(0x99ca53)));
theme->setHighlightLightStrength(7.0f);
@@ -758,7 +760,9 @@ void GraphModifier::useOwnTheme()
void GraphModifier::changeBaseColor(const QColor &color)
{
qDebug() << "base color changed to" << color;
- m_graph->theme()->setBaseColor(color);
+ QList<QColor> colors;
+ colors.append(color);
+ m_graph->theme()->setBaseColors(colors);
}
void GraphModifier::setGradient()
@@ -787,7 +791,9 @@ void GraphModifier::setGradient()
multiHighlightGradient.setColorAt(0.25, Qt::darkYellow);
multiHighlightGradient.setColorAt(0.0, Qt::darkGray);
- m_graph->theme()->setBaseGradient(barGradient);
+ QList<QLinearGradient> barGradients;
+ barGradients.append(barGradient);
+ m_graph->theme()->setBaseGradients(barGradients);
m_graph->theme()->setSingleHighlightGradient(singleHighlightGradient);
m_graph->theme()->setMultiHighlightGradient(multiHighlightGradient);
diff --git a/tests/multigraphs/data.cpp b/tests/multigraphs/data.cpp
index fac341d8..00747695 100644
--- a/tests/multigraphs/data.cpp
+++ b/tests/multigraphs/data.cpp
@@ -53,12 +53,13 @@ Data::Data(Q3DSurface *surface, Q3DScatter *scatter, Q3DBars *bars,
gradient.setColorAt(1.0, Qt::yellow);
m_surface->setSelectionMode(QDataVis::SelectionNone);
m_surface->theme()->setGridEnabled(false);
- m_surface->setGradient(gradient);
m_surface->theme()->setBackgroundEnabled(false);
m_surface->scene()->activeCamera()->setCameraPosition(0.0, 90.0, 150);
QSurface3DSeries *series1 = new QSurface3DSeries(new QHeightMapSurfaceDataProxy());
series1->setFlatShadingEnabled(true);
series1->setSurfaceGridEnabled(false);
+ series1->setColorStyle(Q3DTheme::ColorStyleRangeGradient);
+ series1->setBaseGradient(gradient);
m_surface->addSeries(series1);
// Initialize scatter
@@ -189,7 +190,7 @@ void Data::useGradientOne()
gradient.setColorAt(0.33, Qt::blue);
gradient.setColorAt(0.67, Qt::red);
gradient.setColorAt(1.0, Qt::yellow);
- m_surface->setGradient(gradient);
+ m_surface->seriesList().at(0)->setBaseGradient(gradient);
m_statusArea->append(QStringLiteral("<b>Colors:</b> Thermal image imitation"));
}
@@ -200,7 +201,7 @@ void Data::useGradientTwo()
gradient.setColorAt(0.0, Qt::white);
gradient.setColorAt(0.8, Qt::red);
gradient.setColorAt(1.0, Qt::green);
- m_surface->setGradient(gradient);
+ m_surface->seriesList().at(0)->setBaseGradient(gradient);
m_statusArea->append(QStringLiteral("<b>Colors:</b> Highlight foreground"));
}