diff options
author | Titta Heikkala <titta.heikkala@qt.io> | 2017-08-30 11:50:54 +0300 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@qt.io> | 2017-08-30 09:25:17 +0000 |
commit | fea42978e68c967aa482dbd9a728c482c15e7858 (patch) | |
tree | e27a3a66901add63eddc93528cf9b4cbdd1a1d8b /examples/charts | |
parent | 0168fe1f95d56850734447b118cdcf1847da1c51 (diff) |
Set window palette in Chart Themes Example
Set the right colors for window palette based on theme in
Chart Themes Example to help test automation.
Change-Id: Ia7ed7fc05fc5193a916ebff29bba8aeceda5f97f
Task-number: QTBUG-62824
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'examples/charts')
-rw-r--r-- | examples/charts/chartthemes/themewidget.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/examples/charts/chartthemes/themewidget.cpp b/examples/charts/chartthemes/themewidget.cpp index f1f28af4..28741443 100644 --- a/examples/charts/chartthemes/themewidget.cpp +++ b/examples/charts/chartthemes/themewidget.cpp @@ -332,35 +332,35 @@ void ThemeWidget::updateUI() if (m_charts.at(0)->chart()->theme() != theme) { for (QChartView *chartView : charts) chartView->chart()->setTheme(theme); + } - QPalette pal = window()->palette(); - if (theme == QChart::ChartThemeLight) { - pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeDark) { - pal.setColor(QPalette::Window, QRgb(0x121218)); - pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); - } else if (theme == QChart::ChartThemeBlueCerulean) { - pal.setColor(QPalette::Window, QRgb(0x40434a)); - pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); - } else if (theme == QChart::ChartThemeBrownSand) { - pal.setColor(QPalette::Window, QRgb(0x9e8965)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeBlueNcs) { - pal.setColor(QPalette::Window, QRgb(0x018bba)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeHighContrast) { - pal.setColor(QPalette::Window, QRgb(0xffab03)); - pal.setColor(QPalette::WindowText, QRgb(0x181818)); - } else if (theme == QChart::ChartThemeBlueIcy) { - pal.setColor(QPalette::Window, QRgb(0xcee7f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else { - pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } - window()->setPalette(pal); + QPalette pal = window()->palette(); + if (theme == QChart::ChartThemeLight) { + pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); + pal.setColor(QPalette::WindowText, QRgb(0x404044)); + } else if (theme == QChart::ChartThemeDark) { + pal.setColor(QPalette::Window, QRgb(0x121218)); + pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); + } else if (theme == QChart::ChartThemeBlueCerulean) { + pal.setColor(QPalette::Window, QRgb(0x40434a)); + pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); + } else if (theme == QChart::ChartThemeBrownSand) { + pal.setColor(QPalette::Window, QRgb(0x9e8965)); + pal.setColor(QPalette::WindowText, QRgb(0x404044)); + } else if (theme == QChart::ChartThemeBlueNcs) { + pal.setColor(QPalette::Window, QRgb(0x018bba)); + pal.setColor(QPalette::WindowText, QRgb(0x404044)); + } else if (theme == QChart::ChartThemeHighContrast) { + pal.setColor(QPalette::Window, QRgb(0xffab03)); + pal.setColor(QPalette::WindowText, QRgb(0x181818)); + } else if (theme == QChart::ChartThemeBlueIcy) { + pal.setColor(QPalette::Window, QRgb(0xcee7f0)); + pal.setColor(QPalette::WindowText, QRgb(0x404044)); + } else { + pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); + pal.setColor(QPalette::WindowText, QRgb(0x404044)); } + window()->setPalette(pal); bool checked = m_antialiasCheckBox->isChecked(); for (QChartView *chart : charts) |