diff options
26 files changed, 42 insertions, 328 deletions
diff --git a/examples/audiolevels/audiolevels.cpp b/examples/audiolevels/audiolevels.cpp index 36820f7c..027b73d5 100644 --- a/examples/audiolevels/audiolevels.cpp +++ b/examples/audiolevels/audiolevels.cpp @@ -43,7 +43,7 @@ AudioLevels::AudioLevels(Q3DBars *chart, QObject *parent) m_graph->valueAxis()->setRange(0.0, 1.0); m_graph->setShadowQuality(QDataVis::ShadowNone); m_graph->setCameraPosition(-20.0, 10.0, 10); - m_graph->setTheme(QDataVis::ThemeHighContrast); + m_graph->setTheme(QDataVis::ThemeIsabelle); QAudioFormat formatAudio; formatAudio.setSampleRate(8000); diff --git a/examples/barchart/main.cpp b/examples/barchart/main.cpp index b71f9831..acebed33 100644 --- a/examples/barchart/main.cpp +++ b/examples/barchart/main.cpp @@ -95,11 +95,11 @@ ChartDataGenerator::ChartDataGenerator(Q3DBars *barchart, QTableWidget *tableWid #else // Set selection mode to zoom row m_chart->setSelectionMode(QDataVis::ModeSliceRow); - m_chart->setFont(QFont("Impact", 25)); + m_chart->setFont(QFont("Impact", 20)); #endif // Set theme - m_chart->setTheme(QDataVis::ThemeLight); + m_chart->setTheme(QDataVis::ThemeDigia); // Set preset camera position m_chart->setCameraPreset(QDataVis::PresetFront); diff --git a/examples/qmlbarchart/qml/qmlbarchart/main.qml b/examples/qmlbarchart/qml/qmlbarchart/main.qml index fa7cd638..17dc5562 100644 --- a/examples/qmlbarchart/qml/qmlbarchart/main.qml +++ b/examples/qmlbarchart/qml/qmlbarchart/main.qml @@ -48,7 +48,8 @@ Item { shadowQuality: Bars3D.ShadowMedium selectionMode: Bars3D.ModeItem font.pointSize: 35 - theme: Bars3D.ThemeBrownSand + theme: Bars3D.ThemeRetro + labelTransparency: Bars3D.TransparencyFromTheme dataProxy: chartData.proxy barThickness: 0.5 barSpacing: Qt.size(0.5, 0.5) diff --git a/examples/qmlscatter/qml/qmlscatter/main.qml b/examples/qmlscatter/qml/qmlscatter/main.qml index 357a21f3..ec049dd3 100644 --- a/examples/qmlscatter/qml/qmlscatter/main.qml +++ b/examples/qmlscatter/qml/qmlscatter/main.qml @@ -41,7 +41,7 @@ Item { font.family: "Lucida Handwriting" font.pointSize: 40 dataProxy: chartData.proxy - theme: Scatter3D.ThemeHighContrast + theme: Scatter3D.ThemeIsabelle shadowQuality: Scatter3D.ShadowSoftLow selectionMode: Scatter3D.ModeItem itemLabelFormat: "X:@xLabel Y:@yLabel Z:@zLabel" @@ -110,10 +110,10 @@ Item { text: "Change Theme" anchors.left: cameraToggle.right onClicked: { - if (testscatter.theme === Scatter3D.ThemeBlueCerulean) { - testscatter.theme = Scatter3D.ThemeHighContrast; + if (testscatter.theme === Scatter3D.ThemeArmyBlue) { + testscatter.theme = Scatter3D.ThemeIsabelle; } else { - testscatter.theme = Scatter3D.ThemeBlueCerulean; + testscatter.theme = Scatter3D.ThemeArmyBlue; } } } diff --git a/examples/rainfall/rainfallchart.cpp b/examples/rainfall/rainfallchart.cpp index 42e78b52..1a1e7b74 100644 --- a/examples/rainfall/rainfallchart.cpp +++ b/examples/rainfall/rainfallchart.cpp @@ -69,7 +69,7 @@ RainfallChart::RainfallChart(Q3DBars *rainfall) m_chart->setSelectionMode(QDataVis::ModeSliceColumn); // Set theme - m_chart->setTheme(QDataVis::ThemeBlueNcs); + m_chart->setTheme(QDataVis::ThemeArmyBlue); // Set preset camera position m_chart->setCameraPreset(QDataVis::PresetIsometricRightHigh); diff --git a/examples/scatterchart/main.cpp b/examples/scatterchart/main.cpp index 8b18f5d4..f61c2ab4 100644 --- a/examples/scatterchart/main.cpp +++ b/examples/scatterchart/main.cpp @@ -53,14 +53,6 @@ int main(int argc, char **argv) hLayout->addLayout(vLayout); QComboBox *themeList = new QComboBox(widget); - themeList->addItem(QStringLiteral("System")); - themeList->addItem(QStringLiteral("Blue Cerulean")); - themeList->addItem(QStringLiteral("Blue Icy")); - themeList->addItem(QStringLiteral("Blue Ncs")); - themeList->addItem(QStringLiteral("Brown Sand")); - themeList->addItem(QStringLiteral("Dark")); - themeList->addItem(QStringLiteral("High Contrast")); - themeList->addItem(QStringLiteral("Light")); themeList->addItem(QStringLiteral("Qt")); themeList->addItem(QStringLiteral("Primary Colors")); themeList->addItem(QStringLiteral("Digia")); @@ -69,7 +61,7 @@ int main(int argc, char **argv) themeList->addItem(QStringLiteral("Retro")); themeList->addItem(QStringLiteral("Ebony")); themeList->addItem(QStringLiteral("Isabelle")); - themeList->setCurrentIndex(4); + themeList->setCurrentIndex(6); QPushButton *labelButton = new QPushButton(widget); labelButton->setText(QStringLiteral("Change label style")); diff --git a/examples/scatterchart/scatterchart.cpp b/examples/scatterchart/scatterchart.cpp index f68b8ad5..88a83567 100644 --- a/examples/scatterchart/scatterchart.cpp +++ b/examples/scatterchart/scatterchart.cpp @@ -36,7 +36,7 @@ ScatterDataModifier::ScatterDataModifier(Q3DScatter *scatter) font.setPointSize(m_fontSize); m_chart->setFont(font); m_chart->setObjectType(QDataVis::Spheres, true); - m_chart->setTheme(QDataVis::ThemeBrownSand); + m_chart->setTheme(QDataVis::ThemeEbony); m_chart->setShadowQuality(QDataVis::ShadowHigh); m_chart->setCameraPreset(QDataVis::PresetFront); m_chart->setAxisX(new Q3DValueAxis); @@ -117,16 +117,6 @@ void ScatterDataModifier::changePresetCamera() preset = QDataVis::PresetFrontLow; } -void ScatterDataModifier::changeTheme() -{ - static int theme = QDataVis::ThemeSystem; - - m_chart->setTheme((QDataVis::ColorTheme)theme); - - if (++theme > QDataVis::ThemeLight) - theme = QDataVis::ThemeSystem; -} - void ScatterDataModifier::changeTransparency() { static int transparency = QDataVis::TransparencyNone; diff --git a/examples/scatterchart/scatterchart.h b/examples/scatterchart/scatterchart.h index 9a1726b9..bfdcb5bc 100644 --- a/examples/scatterchart/scatterchart.h +++ b/examples/scatterchart/scatterchart.h @@ -34,7 +34,6 @@ public: void addData(); void changeStyle(); void changePresetCamera(); - void changeTheme(); void changeTransparency(); void changeFont(const QFont &font); void changeFontSize(int fontsize); diff --git a/examples/surfacechart/main.cpp b/examples/surfacechart/main.cpp index de7987b1..3b6ece67 100644 --- a/examples/surfacechart/main.cpp +++ b/examples/surfacechart/main.cpp @@ -116,15 +116,15 @@ int main(int argc, char *argv[]) labelButton->setText(QStringLiteral("Change label style")); QComboBox *themeList = new QComboBox(widget); - themeList->addItem(QStringLiteral("System")); - themeList->addItem(QStringLiteral("Blue Cerulean")); - themeList->addItem(QStringLiteral("Blue Icy")); - themeList->addItem(QStringLiteral("Blue Ncs")); - themeList->addItem(QStringLiteral("Brown Sand")); - themeList->addItem(QStringLiteral("Dark")); - themeList->addItem(QStringLiteral("High Contrast")); - themeList->addItem(QStringLiteral("Light")); - themeList->setCurrentIndex(4); + themeList->addItem(QStringLiteral("Qt")); + themeList->addItem(QStringLiteral("Primary Colors")); + themeList->addItem(QStringLiteral("Digia")); + themeList->addItem(QStringLiteral("Stone Moss")); + themeList->addItem(QStringLiteral("Army Blue")); + themeList->addItem(QStringLiteral("Retro")); + themeList->addItem(QStringLiteral("Ebony")); + themeList->addItem(QStringLiteral("Isabelle")); + themeList->setCurrentIndex(0); QComboBox *shadowQuality = new QComboBox(widget); shadowQuality->addItem(QStringLiteral("None")); diff --git a/examples/widget/main.cpp b/examples/widget/main.cpp index de2776fd..86ee49a3 100644 --- a/examples/widget/main.cpp +++ b/examples/widget/main.cpp @@ -53,14 +53,6 @@ int main(int argc, char **argv) hLayout->addLayout(vLayout); QComboBox *themeList = new QComboBox(widget); - themeList->addItem(QStringLiteral("System")); - themeList->addItem(QStringLiteral("Blue Cerulean")); - themeList->addItem(QStringLiteral("Blue Icy")); - themeList->addItem(QStringLiteral("Blue Ncs")); - themeList->addItem(QStringLiteral("Brown Sand")); - themeList->addItem(QStringLiteral("Dark")); - themeList->addItem(QStringLiteral("High Contrast")); - themeList->addItem(QStringLiteral("Light")); themeList->addItem(QStringLiteral("Qt")); themeList->addItem(QStringLiteral("Primary Colors")); themeList->addItem(QStringLiteral("Digia")); diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index 7c98f804..b5bd04d5 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -59,7 +59,7 @@ Abstract3DController::Abstract3DController(QRect boundRect, QObject *parent) : m_data(0), m_renderPending(false) { - m_theme.useColorTheme(QDataVis::ThemeSystem); + m_theme.useColorTheme(QDataVis::ThemeQt); // Populate the scene m_scene->activeLight()->setPosition(defaultLightPos); diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp index 15f8cc32..a60fe190 100644 --- a/src/datavisualization/engine/q3dbars.cpp +++ b/src/datavisualization/engine/q3dbars.cpp @@ -432,7 +432,7 @@ void Q3DBars::setCameraPosition(qreal horizontal, qreal vertical, int distance) } /*! - * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by + * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by * default. Theme affects bar colors, label colors, text color, background color, window color and * grid color. Lighting is also adjusted by themes. * diff --git a/src/datavisualization/engine/q3dscatter.cpp b/src/datavisualization/engine/q3dscatter.cpp index a3503ef1..715f2b18 100644 --- a/src/datavisualization/engine/q3dscatter.cpp +++ b/src/datavisualization/engine/q3dscatter.cpp @@ -341,7 +341,7 @@ void Q3DScatter::setCameraPosition(qreal horizontal, qreal vertical, int distanc } /*! - * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by + * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by * default. Theme affects bar colors, label colors, text color, background color, window color and * grid color. Lighting is also adjusted by themes. * diff --git a/src/datavisualization/engine/q3dsurface.cpp b/src/datavisualization/engine/q3dsurface.cpp index fe4d4b61..23a1b14b 100644 --- a/src/datavisualization/engine/q3dsurface.cpp +++ b/src/datavisualization/engine/q3dsurface.cpp @@ -315,7 +315,7 @@ bool Q3DSurface::isBackgroundVisible() const } /*! - * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by + * Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by * default. Theme affects label colors, text color, background color, window color and * grid color. Lighting is also adjusted by themes. * diff --git a/src/datavisualization/engine/theme.cpp b/src/datavisualization/engine/theme.cpp index 23dc6705..dfa189a4 100644 --- a/src/datavisualization/engine/theme.cpp +++ b/src/datavisualization/engine/theme.cpp @@ -60,236 +60,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) { m_colorTheme = colorTheme; switch (colorTheme) { - case QDataVis::ThemeSystem: { -#ifdef Q_OS_WIN - DWORD colorHighlight; - colorHighlight = GetSysColor(COLOR_HIGHLIGHT); - m_baseColor = QColor(GetRValue(colorHighlight), - GetGValue(colorHighlight), - GetBValue(colorHighlight)); - DWORD colorWindowFrame; - colorWindowFrame = GetSysColor(COLOR_WINDOWFRAME); - m_heightColor = QColor(GetRValue(colorWindowFrame), - GetGValue(colorWindowFrame), - GetBValue(colorWindowFrame)); - m_depthColor = QColor(Qt::black); - DWORD colorWindow; - colorWindow = GetSysColor(COLOR_WINDOW); - m_backgroundColor = QColor(GetRValue(colorWindow), - GetGValue(colorWindow), - GetBValue(colorWindow)); - m_windowColor = QColor(GetRValue(colorWindow), - GetGValue(colorWindow), - GetBValue(colorWindow)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0); - m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0xe2e2e2)); - m_highlightRowColor = QColor(QRgb(0xf2f2f2)); - m_highlightColumnColor = QColor(QRgb(0xf2f2f2)); - m_lightStrength = 4.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 6.0f; -#elif defined(Q_OS_LINUX) - m_baseColor = QColor(QRgb(0x60a6e6)); - m_heightColor = QColor(QRgb(0xfc5751)); - m_depthColor = QColor(QRgb(0x92ca66)); - m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0); - m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0xeba85f)); - m_highlightRowColor = QColor(QRgb(0xfc5751)); - m_highlightColumnColor = QColor(QRgb(0xfc5751)); - m_lightStrength = 4.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 6.0f; -#elif defined(Q_OS_MAC) - m_baseColor = QColor(QRgb(0x60a6e6)); - m_heightColor = QColor(QRgb(0xfc5751)); - m_depthColor = QColor(QRgb(0x92ca66)); - m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0); - m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0xeba85f)); - m_highlightRowColor = QColor(QRgb(0xfc5751)); - m_highlightColumnColor = QColor(QRgb(0xfc5751)); - m_lightStrength = 4.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 6.0f; -#else - m_baseColor = QColor(QRgb(0x60a6e6)); - m_heightColor = QColor(QRgb(0xfc5751)); - m_depthColor = QColor(QRgb(0x92ca66)); - m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0); - m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0xeba85f)); - m_highlightRowColor = QColor(QRgb(0xfc5751)); - m_highlightColumnColor = QColor(QRgb(0xfc5751)); - m_lightStrength = 4.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 6.0f; -#endif - m_uniformColor = true; - m_labelBorders = true; - break; - } - case QDataVis::ThemeBlueCerulean: { - m_baseColor = QColor(QRgb(0xc7e85b)); - m_heightColor = QColor(QRgb(0xee7392)); - m_depthColor = QColor(QRgb(0x1cb54f)); - m_backgroundColor = QColor(QRgb(0x056189)); - m_windowColor = QColor(QRgb(0x101a31)); - m_textColor = QColor(QRgb(0xffffff)); - m_textBackgroundColor = QColor(0x05, 0x61, 0x89, 0xa0); - m_gridLine = QColor(QRgb(0xee7392)); - //m_gridLine = QColor(QRgb(0x84a2b0)); - m_highlightBarColor = QColor(QRgb(0x5cbf9b)); - m_highlightRowColor = QColor(QRgb(0x009fbf)); - m_highlightColumnColor = QColor(QRgb(0x009fbf)); - m_lightStrength = 5.0f; - m_ambientStrength = 0.2f; - m_highlightLightStrength = 10.0f; - m_uniformColor = true; - m_labelBorders = false; - break; - } - case QDataVis::ThemeBlueIcy: { - m_baseColor = QRgb(0x3daeda); - m_heightColor = QRgb(0x2fa3b4); - m_depthColor = QColor(QRgb(0x2685bf)); - m_backgroundColor = QColor(QRgb(0x2fa3b4)); - //m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0x26, 0x85, 0xbf, 0xa0); - //m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x80); - m_gridLine = QColor(QRgb(0x2685bf)); - //m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0x0c2673)); - m_highlightRowColor = QColor(QRgb(0x5f3dba)); - m_highlightColumnColor = QColor(QRgb(0x5f3dba)); - m_lightStrength = 5.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 8.0f; - m_uniformColor = true; - m_labelBorders = false; - break; - } - case QDataVis::ThemeBlueNcs: { - m_baseColor = QColor(QRgb(0x1db0da)); - m_heightColor = QColor(QRgb(0x398ca3)); - m_depthColor = QColor(QRgb(0x1341a6)); - m_backgroundColor = QColor(QRgb(0x398ca3)); - //m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0x1d, 0xb0, 0xda, 0xa0); - //m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x80); - m_gridLine = QColor(QRgb(0x1341a6)); - //m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0x88d41e)); - m_highlightRowColor = QColor(QRgb(0xff8e1a)); - m_highlightColumnColor = QColor(QRgb(0xff8e1a)); - m_lightStrength = 4.0f; - m_ambientStrength = 0.2f; - m_highlightLightStrength = 6.0f; - m_uniformColor = true; - m_labelBorders = false; - break; - } - case QDataVis::ThemeBrownSand: { - m_baseColor = QColor(QRgb(0xb39b72)); - m_heightColor = QColor(QRgb(0x494345)); - m_depthColor = QColor(QRgb(0xb3b376)); - m_backgroundColor = QColor(QRgb(0x494345)); - //m_backgroundColor = QColor(QRgb(0xf3ece0)); - m_windowColor = QColor(QRgb(0xf3ece0)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xb5, 0xb0, 0xa7, 0xa0); - m_gridLine = QColor(QRgb(0xb3b376)); - //m_gridLine = QColor(QRgb(0xd4cec3)); - m_highlightBarColor = QColor(QRgb(0xc35660)); - m_highlightRowColor = QColor(QRgb(0x536780)); - m_highlightColumnColor = QColor(QRgb(0x536780)); - m_lightStrength = 6.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 8.0f; - m_uniformColor = false; - m_labelBorders = false; - break; - } - case QDataVis::ThemeDark: { - m_baseColor = QColor(QRgb(0x38ad6b)); // charts: series color 1 - m_heightColor = QColor(QRgb(0xbf593e)); // charts: series color 5 - m_depthColor = QColor(QRgb(0x3c84a7)); // charts: series color 2 - m_backgroundColor = QColor(QRgb(0x2e303a)); // charts: background color 1 - m_windowColor = QColor(QRgb(0x121218)); // charts: background color 2 - m_textColor = QColor(QRgb(0xffffff)); // charts: label color - m_textBackgroundColor = QColor(0x86, 0x87, 0x8c, 0xa0); // charts: axis line pen OR background color 2 - m_gridLine = QColor(QRgb(0xbf593e)); // charts: grid line color - //m_gridLine = QColor(QRgb(0x86878c)); // charts: grid line color - m_highlightBarColor = QColor(QRgb(0xeb8817)); // charts: series color 3 - m_highlightRowColor = QColor(QRgb(0x7b7f8c)); // charts: series color 4 - m_highlightColumnColor = QColor(QRgb(0x7b7f8c)); // charts: series color 4 - m_lightStrength = 6.0f; - m_ambientStrength = 0.2f; - m_highlightLightStrength = 8.0f; - m_uniformColor = false; - m_labelBorders = true; - break; - } - case QDataVis::ThemeHighContrast: { - m_baseColor = QColor(QRgb(0xff4a41)); - m_heightColor = QColor(QRgb(0x202020)); - m_depthColor = QColor(QRgb(0x596a74)); - m_backgroundColor = QColor(QRgb(0x596a74)); - //m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0x000000)); - m_textColor = QColor(QRgb(0xffffff)); - m_textBackgroundColor = QColor(0x20, 0x20, 0x20, 0xa0); - //m_textColor = QColor(QRgb(0x181818)); - //m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0xa0); - m_gridLine = QColor(QRgb(0xffab03)); - //m_gridLine = QColor(QRgb(0x8c8c8c)); - m_highlightBarColor = QColor(QRgb(0xffab03)); - m_highlightRowColor = QColor(QRgb(0x038e9b)); - m_highlightColumnColor = QColor(QRgb(0x038e9b)); - m_lightStrength = 8.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 10.0f; - m_uniformColor = false; - m_labelBorders = true; - break; - } - case QDataVis::ThemeLight: { - m_baseColor = QColor(QRgb(0x209fdf)); - m_heightColor = QColor(QRgb(0xbf593e)); - m_depthColor = QColor(QRgb(0x99ca53)); - m_backgroundColor = QColor(QRgb(0x99ca53)); - //m_backgroundColor = QColor(QRgb(0xffffff)); - m_windowColor = QColor(QRgb(0xffffff)); - m_textColor = QColor(QRgb(0x404044)); - m_textBackgroundColor = QColor(0xf6, 0xa6, 0x25, 0xa0); - //m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0); - m_gridLine = QColor(QRgb(0x99ca53)); - //m_gridLine = QColor(QRgb(0xe2e2e2)); - m_highlightBarColor = QColor(QRgb(0xf6a625)); - m_highlightRowColor = QColor(QRgb(0x6d5fd5)); - m_highlightColumnColor = QColor(QRgb(0x6d5fd5)); - m_lightStrength = 6.0f; - m_ambientStrength = 0.3f; - m_highlightLightStrength = 7.0f; - m_uniformColor = true; - m_labelBorders = false; - break; - } case QDataVis::ThemeQt: { m_baseColor = QColor(QRgb(0x80c342)); //m_heightColor = QColor(QRgb(0x)); diff --git a/src/datavisualization/engine/theme_p.h b/src/datavisualization/engine/theme_p.h index 246ebf93..e8e7231a 100644 --- a/src/datavisualization/engine/theme_p.h +++ b/src/datavisualization/engine/theme_p.h @@ -37,7 +37,7 @@ class QColor; QT_DATAVISUALIZATION_BEGIN_NAMESPACE -class Theme +class QT_DATAVISUALIZATION_EXPORT Theme { public: explicit Theme(); diff --git a/src/datavisualization/global/qdatavisualizationenums.h b/src/datavisualization/global/qdatavisualizationenums.h index 06365950..72ae2901 100644 --- a/src/datavisualization/global/qdatavisualizationenums.h +++ b/src/datavisualization/global/qdatavisualizationenums.h @@ -85,14 +85,6 @@ public: enum ColorTheme { ThemeDefault = -1, - ThemeSystem = 0, - ThemeBlueCerulean, - ThemeBlueIcy, - ThemeBlueNcs, - ThemeBrownSand, - ThemeDark, - ThemeHighContrast, - ThemeLight, ThemeQt, ThemePrimaryColors, ThemeDigia, diff --git a/src/datavisualization/global/qtdatavisualizationenums.qdoc b/src/datavisualization/global/qtdatavisualizationenums.qdoc index 6304b85e..c5f48412 100644 --- a/src/datavisualization/global/qtdatavisualizationenums.qdoc +++ b/src/datavisualization/global/qtdatavisualizationenums.qdoc @@ -105,14 +105,6 @@ \value ThemeDefault Used only in QML to indicate a theme has not been set. - \value ThemeSystem - \value ThemeBlueCerulean - \value ThemeBlueIcy - \value ThemeBlueNcs - \value ThemeBrownSand - \value ThemeDark - \value ThemeHighContrast - \value ThemeLight \value ThemeQt \value ThemePrimaryColors \value ThemeDigia diff --git a/src/datavisualizationqml2/declarativebars.cpp b/src/datavisualizationqml2/declarativebars.cpp index dd575d35..c757c804 100644 --- a/src/datavisualizationqml2/declarativebars.cpp +++ b/src/datavisualizationqml2/declarativebars.cpp @@ -20,6 +20,7 @@ #include "declarativebarsrenderer_p.h" #include "q3dvalueaxis.h" #include "qitemmodelbardataproxy.h" +#include "theme_p.h" QT_DATAVISUALIZATION_BEGIN_NAMESPACE @@ -28,8 +29,7 @@ const QString smoothString(QStringLiteral("Smooth")); DeclarativeBars::DeclarativeBars(QQuickItem *parent) : QQuickItem(parent), m_shared(0), - m_initialisedSize(0, 0), - m_theme(QDataVis::ThemeDefault) + m_initialisedSize(0, 0) { setFlags(QQuickItem::ItemHasContents); setAcceptedMouseButtons(Qt::AllButtons); @@ -224,14 +224,12 @@ QDataVis::CameraPreset DeclarativeBars::cameraPreset() void DeclarativeBars::setTheme(QDataVis::ColorTheme theme) { // TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented - // We need to save this locally, as there are no getters for it in controller - m_theme = theme; m_shared->setColorTheme(theme); } QDataVis::ColorTheme DeclarativeBars::theme() { - return m_theme; + return m_shared->theme().colorTheme(); } void DeclarativeBars::setFont(const QFont &font) diff --git a/src/datavisualizationqml2/declarativebars_p.h b/src/datavisualizationqml2/declarativebars_p.h index b2e64eae..78223773 100644 --- a/src/datavisualizationqml2/declarativebars_p.h +++ b/src/datavisualizationqml2/declarativebars_p.h @@ -182,7 +182,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::ColorTheme m_theme; }; QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/src/datavisualizationqml2/declarativescatter.cpp b/src/datavisualizationqml2/declarativescatter.cpp index 3c3b1371..34a11024 100644 --- a/src/datavisualizationqml2/declarativescatter.cpp +++ b/src/datavisualizationqml2/declarativescatter.cpp @@ -19,6 +19,7 @@ #include "declarativescatter_p.h" #include "declarativescatterrenderer_p.h" #include "qitemmodelscatterdataproxy.h" +#include "theme_p.h" QT_DATAVISUALIZATION_BEGIN_NAMESPACE @@ -27,8 +28,7 @@ const QString smoothString(QStringLiteral("Smooth")); DeclarativeScatter::DeclarativeScatter(QQuickItem *parent) : QQuickItem(parent), m_shared(0), - m_initialisedSize(0, 0), - m_theme(QDataVis::ThemeDefault) + m_initialisedSize(0, 0) { setFlags(QQuickItem::ItemHasContents); setAcceptedMouseButtons(Qt::AllButtons); @@ -189,19 +189,12 @@ QDataVis::CameraPreset DeclarativeScatter::cameraPreset() void DeclarativeScatter::setTheme(QDataVis::ColorTheme theme) { - // TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented - // We need to save this locally, as there are no getters for it in controller - m_theme = theme; m_shared->setColorTheme(theme); - - // TODO: Investigate why the beforeSynchronizing() signal requires update and is not sent automatically when this value changes, - // but is sent wen e.g. enable/disable background changes. - update(); } QDataVis::ColorTheme DeclarativeScatter::theme() { - return m_theme; + return m_shared->theme().colorTheme(); } void DeclarativeScatter::setFont(const QFont &font) diff --git a/src/datavisualizationqml2/declarativescatter_p.h b/src/datavisualizationqml2/declarativescatter_p.h index 6c70a146..4541df8e 100644 --- a/src/datavisualizationqml2/declarativescatter_p.h +++ b/src/datavisualizationqml2/declarativescatter_p.h @@ -157,7 +157,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::ColorTheme m_theme; }; QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/src/datavisualizationqml2/declarativesurface.cpp b/src/datavisualizationqml2/declarativesurface.cpp index d238c9ad..551f6dbc 100644 --- a/src/datavisualizationqml2/declarativesurface.cpp +++ b/src/datavisualizationqml2/declarativesurface.cpp @@ -20,14 +20,14 @@ #include "declarativesurfacerenderer_p.h" #include "q3dvalueaxis.h" #include "qitemmodelsurfacedataproxy.h" +#include "theme_p.h" QT_DATAVISUALIZATION_BEGIN_NAMESPACE DeclarativeSurface::DeclarativeSurface(QQuickItem *parent) : QQuickItem(parent), m_shared(0), - m_initialisedSize(0, 0), - m_theme(QDataVis::ThemeDefault) + m_initialisedSize(0, 0) { setFlags(QQuickItem::ItemHasContents); setAcceptedMouseButtons(Qt::AllButtons); @@ -137,14 +137,12 @@ void DeclarativeSurface::setAxisZ(Q3DValueAxis *axis) void DeclarativeSurface::setTheme(QDataVis::ColorTheme theme) { // TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented - // We need to save this locally, as there are no getters for it in controller - m_theme = theme; m_shared->setColorTheme(theme); } QDataVis::ColorTheme DeclarativeSurface::theme() { - return m_theme; + return m_shared->theme().colorTheme(); } void DeclarativeSurface::setFont(const QFont &font) diff --git a/src/datavisualizationqml2/declarativesurface_p.h b/src/datavisualizationqml2/declarativesurface_p.h index cc20449d..7884483b 100644 --- a/src/datavisualizationqml2/declarativesurface_p.h +++ b/src/datavisualizationqml2/declarativesurface_p.h @@ -147,7 +147,6 @@ protected: private: QSize m_initialisedSize; - QDataVis::ColorTheme m_theme; }; QT_DATAVISUALIZATION_END_NAMESPACE diff --git a/tests/barstest/chart.cpp b/tests/barstest/chart.cpp index b8ef0758..cfc072de 100644 --- a/tests/barstest/chart.cpp +++ b/tests/barstest/chart.cpp @@ -453,12 +453,12 @@ void ChartModifier::changePresetCamera() void ChartModifier::changeTheme() { - static int theme = QDataVis::ThemeSystem; + static int theme = QDataVis::ThemeQt; m_chart->setTheme((QDataVis::ColorTheme)theme); - if (++theme > QDataVis::ThemeLight) - theme = QDataVis::ThemeSystem; + if (++theme > QDataVis::ThemeIsabelle) + theme = QDataVis::ThemeQt; } void ChartModifier::changeTransparency() diff --git a/tests/scattertest/scatterchart.cpp b/tests/scattertest/scatterchart.cpp index 90346559..1ddf61cd 100644 --- a/tests/scattertest/scatterchart.cpp +++ b/tests/scattertest/scatterchart.cpp @@ -35,7 +35,7 @@ ScatterDataModifier::ScatterDataModifier(Q3DScatter *scatter) font.setPointSize(m_fontSize); m_chart->setFont(font); m_chart->setObjectType(QDataVis::Spheres, true); - m_chart->setTheme(QDataVis::ThemeBrownSand); + m_chart->setTheme(QDataVis::ThemeStoneMoss); m_chart->setShadowQuality(QDataVis::ShadowHigh); m_chart->setCameraPreset(QDataVis::PresetFront); m_chart->setAxisX(new Q3DValueAxis); @@ -125,12 +125,12 @@ void ScatterDataModifier::changePresetCamera() void ScatterDataModifier::changeTheme() { - static int theme = QDataVis::ThemeSystem; + static int theme = QDataVis::ThemeQt; m_chart->setTheme((QDataVis::ColorTheme)theme); - if (++theme > QDataVis::ThemeLight) - theme = QDataVis::ThemeSystem; + if (++theme > QDataVis::ThemeIsabelle) + theme = QDataVis::ThemeQt; } void ScatterDataModifier::changeTransparency() |