MCPcopy Index your code
hub / github.com/PyQt5/PyQt / updateUI

Method updateUI

QtChart/ChartThemes.py:304–363  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302
303 @pyqtSlot()
304 def updateUI(self):
305 theme = self.m_themeComboBox.itemData(
306 self.m_themeComboBox.currentIndex())
307
308 if self.m_charts[0].chart().theme() != theme:
309 for chartView in self.m_charts:
310 chartView.chart().setTheme(QChart.ChartTheme(theme))
311
312 pal = self.window().palette()
313
314 if theme == QChart.ChartThemeLight:
315 pal.setColor(QPalette.Window, QColor(0xf0f0f0))
316 pal.setColor(QPalette.WindowText, QColor(0x404044))
317 elif theme == QChart.ChartThemeDark:
318 pal.setColor(QPalette.Window, QColor(0x121218))
319 pal.setColor(QPalette.WindowText, QColor(0xd6d6d6))
320 elif theme == QChart.ChartThemeBlueCerulean:
321 pal.setColor(QPalette.Window, QColor(0x40434a))
322 pal.setColor(QPalette.WindowText, QColor(0xd6d6d6))
323 elif theme == QChart.ChartThemeBrownSand:
324 pal.setColor(QPalette.Window, QColor(0x9e8965))
325 pal.setColor(QPalette.WindowText, QColor(0x404044))
326 elif theme == QChart.ChartThemeBlueNcs:
327 pal.setColor(QPalette.Window, QColor(0x018bba))
328 pal.setColor(QPalette.WindowText, QColor(0x404044))
329 elif theme == QChart.ChartThemeHighContrast:
330 pal.setColor(QPalette.Window, QColor(0xffab03))
331 pal.setColor(QPalette.WindowText, QColor(0x181818))
332 elif theme == QChart.ChartThemeBlueIcy:
333 pal.setColor(QPalette.Window, QColor(0xcee7f0))
334 pal.setColor(QPalette.WindowText, QColor(0x404044))
335 else:
336 pal.setColor(QPalette.Window, QColor(0xf0f0f0))
337 pal.setColor(QPalette.WindowText, QColor(0x404044))
338
339 self.window().setPalette(pal)
340
341 checked = self.m_antialiasCheckBox.isChecked()
342 for chartView in self.m_charts:
343 chartView.setRenderHint(QPainter.Antialiasing, checked)
344
345 options = QChart.AnimationOptions(
346 self.m_animatedComboBox.itemData(
347 self.m_animatedComboBox.currentIndex()))
348
349 if self.m_charts[0].chart().animationOptions() != options:
350 for chartView in self.m_charts:
351 chartView.chart().setAnimationOptions(options)
352
353 alignment = self.m_legendComboBox.itemData(
354 self.m_legendComboBox.currentIndex())
355
356 for chartView in self.m_charts:
357 legend = chartView.chart().legend()
358
359 if alignment == 0:
360 legend.hide()
361 else:

Callers 1

__init__Method · 0.95

Calls 2

setColorMethod · 0.80
showMethod · 0.45

Tested by

no test coverage detected