(self, parent=None)
| 58 | class ThemeWidget(QWidget): |
| 59 | |
| 60 | def __init__(self, parent=None): |
| 61 | super(ThemeWidget, self).__init__(parent) |
| 62 | |
| 63 | self.m_charts = [] |
| 64 | self.m_listCount = 3 |
| 65 | self.m_valueMax = 10 |
| 66 | self.m_valueCount = 7 |
| 67 | self.m_dataTable = self.generateRandomData(self.m_listCount, |
| 68 | self.m_valueMax, self.m_valueCount) |
| 69 | self.m_themeComboBox = self.createThemeBox() |
| 70 | self.m_antialiasCheckBox = QCheckBox("Anti-aliasing") |
| 71 | self.m_animatedComboBox = self.createAnimationBox() |
| 72 | self.m_legendComboBox = self.createLegendBox() |
| 73 | |
| 74 | self.connectSignals() |
| 75 | |
| 76 | # Create the layout. |
| 77 | baseLayout = QGridLayout() |
| 78 | settingsLayout = QHBoxLayout() |
| 79 | settingsLayout.addWidget(QLabel("Theme:")) |
| 80 | settingsLayout.addWidget(self.m_themeComboBox) |
| 81 | settingsLayout.addWidget(QLabel("Animation:")) |
| 82 | settingsLayout.addWidget(self.m_animatedComboBox) |
| 83 | settingsLayout.addWidget(QLabel("Legend:")) |
| 84 | settingsLayout.addWidget(self.m_legendComboBox) |
| 85 | settingsLayout.addWidget(self.m_antialiasCheckBox) |
| 86 | settingsLayout.addStretch() |
| 87 | baseLayout.addLayout(settingsLayout, 0, 0, 1, 3) |
| 88 | |
| 89 | # Create the charts. |
| 90 | chartView = QChartView(self.createAreaChart()) |
| 91 | baseLayout.addWidget(chartView, 1, 0) |
| 92 | self.m_charts.append(chartView) |
| 93 | |
| 94 | chartView = QChartView(self.createBarChart(self.m_valueCount)) |
| 95 | baseLayout.addWidget(chartView, 1, 1) |
| 96 | self.m_charts.append(chartView) |
| 97 | |
| 98 | chartView = QChartView(self.createLineChart()) |
| 99 | baseLayout.addWidget(chartView, 1, 2) |
| 100 | self.m_charts.append(chartView) |
| 101 | |
| 102 | chartView = QChartView(self.createPieChart()) |
| 103 | # Funny things happen if the pie slice labels no not fit the screen... |
| 104 | chartView.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) |
| 105 | baseLayout.addWidget(chartView, 2, 0) |
| 106 | self.m_charts.append(chartView) |
| 107 | |
| 108 | chartView = QChartView(self.createSplineChart()) |
| 109 | baseLayout.addWidget(chartView, 2, 1) |
| 110 | self.m_charts.append(chartView) |
| 111 | |
| 112 | chartView = QChartView(self.createScatterChart()) |
| 113 | baseLayout.addWidget(chartView, 2, 2) |
| 114 | self.m_charts.append(chartView) |
| 115 | |
| 116 | self.setLayout(baseLayout) |
| 117 |
nothing calls this directly
no test coverage detected