MCPcopy Create free account
hub / github.com/KDE/labplot / setPlots

Method setPlots

src/frontend/dockwidgets/ProcessBehaviorChartDock.cpp:146–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void ProcessBehaviorChartDock::setPlots(QList<ProcessBehaviorChart*> list) {
147 Lock lock(m_initializing);
148 m_plots = list;
149 m_plot = list.first();
150 setAspects(list);
151 Q_ASSERT(m_plot);
152 setModel();
153
154 // initialize widgets for common properties
155 QList<Line*> dataLines;
156 QList<Symbol*> dataSymbols;
157 QList<Line*> centerLines;
158 QList<Line*> upperLimitLines;
159 QList<Line*> lowerLimitLines;
160 for (auto* plot : m_plots) {
161 dataLines << plot->dataLine();
162 dataSymbols << plot->dataSymbol();
163 centerLines << plot->centerLine();
164 upperLimitLines << plot->upperLimitLine();
165 if (m_plot->lowerLimitAvailable())
166 lowerLimitLines << plot->lowerLimitLine();
167 }
168 dataLineWidget->setLines(dataLines);
169 dataSymbolWidget->setSymbols(dataSymbols);
170 centerLineWidget->setLines(centerLines);
171 upperLimitLineWidget->setLines(upperLimitLines);
172 if (m_plot->lowerLimitAvailable())
173 lowerLimitLineWidget->setLines(lowerLimitLines);
174
175 // if there are more then one curve in the list, disable the content in the tab "general"
176 if (m_plots.size() == 1) {
177 cbDataColumn->setEnabled(true);
178 cbDataColumn->setAspect(m_plot->dataColumn(), m_plot->dataColumnPath());
179 cbData2Column->setEnabled(true);
180 cbData2Column->setAspect(m_plot->data2Column(), m_plot->data2ColumnPath());
181 } else {
182 cbDataColumn->setEnabled(false);
183 cbDataColumn->setCurrentModelIndex(QModelIndex());
184 cbData2Column->setEnabled(false);
185 cbData2Column->setCurrentModelIndex(QModelIndex());
186 }
187
188 ui.chkLegendVisible->setChecked(m_plot->legendVisible());
189 ui.chkVisible->setChecked(m_plot->isVisible());
190
191 // load the remaining properties
192 load();
193
194 showStatusInfo(QString()); // remove the message from the previous chart, if available
195 updatePlotRangeList();
196
197 // Slots
198 // General-tab
199 connect(m_plot, &ProcessBehaviorChart::dataColumnChanged, this, &ProcessBehaviorChartDock::plotDataColumnChanged);
200 connect(m_plot, &ProcessBehaviorChart::data2ColumnChanged, this, &ProcessBehaviorChartDock::plotData2ColumnChanged);
201 connect(m_plot, &ProcessBehaviorChart::typeChanged, this, &ProcessBehaviorChartDock::plotTypeChanged);
202 connect(m_plot, &ProcessBehaviorChart::limitsMetricChanged, this, &ProcessBehaviorChartDock::plotLimitsMetricChanged);
203 connect(m_plot, &ProcessBehaviorChart::sampleSizeChanged, this, &ProcessBehaviorChartDock::plotSampleSizeChanged);

Callers

nothing calls this directly

Calls 15

upperLimitLineMethod · 0.80
lowerLimitAvailableMethod · 0.80
lowerLimitLineMethod · 0.80
setLinesMethod · 0.80
setAspectMethod · 0.80
setCurrentModelIndexMethod · 0.80
QModelIndexClass · 0.50
QStringClass · 0.50
dataLineMethod · 0.45
dataSymbolMethod · 0.45
centerLineMethod · 0.45
setSymbolsMethod · 0.45

Tested by

no test coverage detected