I want to apply a chart theme to a specific widget.
Unsolved
General and Desktop
-
@meria0503
What is a "charttheme", and how is it set, globally?
If it is CSS you can apply that to anyQWidget
-derived element viasetStyle()
and it only applies to that element downward (i.e. it descendants), so put it on whatever the closest widget ancestor to your chart is. -
@meria0503
I see in https://doc.qt.io/qt-5/qtcharts-chartthemes-example.html#changing-theme:The user can select a built-in theme to be used in the example. This theme is then applied to all charts in the layout.
QChart::ChartTheme theme = static_cast<QChart::ChartTheme>( m_ui->themeComboBox->itemData(m_ui->themeComboBox->currentIndex()).toInt()); chartView->chart()->setTheme(theme);
I know no more than what it states there.