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

Method setPlots

src/frontend/dockwidgets/RunChartDock.cpp:99–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void RunChartDock::setPlots(QList<RunChart*> list) {
100 Lock lock(m_initializing);
101 m_plots = list;
102 m_plot = list.first();
103 setAspects(list);
104 Q_ASSERT(m_plot);
105 setModel();
106
107 // initialize widgets for common properties
108 QList<Line*> dataLines;
109 QList<Symbol*> dataSymbols;
110 QList<Line*> centerLines;
111 for (auto* plot : m_plots) {
112 dataLines << plot->dataLine();
113 dataSymbols << plot->dataSymbol();
114 centerLines << plot->centerLine();
115 }
116 dataLineWidget->setLines(dataLines);
117 dataSymbolWidget->setSymbols(dataSymbols);
118 centerLineWidget->setLines(centerLines);
119
120 // if there are more then one curve in the list, disable the content in the tab "general"
121 if (m_plots.size() == 1) {
122 cbDataColumn->setEnabled(true);
123 cbDataColumn->setAspect(m_plot->dataColumn(), m_plot->dataColumnPath());
124 } else {
125 cbDataColumn->setEnabled(false);
126 cbDataColumn->setCurrentModelIndex(QModelIndex());
127 }
128
129 ui.chkLegendVisible->setChecked(m_plot->legendVisible());
130 ui.chkVisible->setChecked(m_plot->isVisible());
131
132 // center metric
133 const int index = ui.cbCenterMetric->findData(static_cast<int>(m_plot->centerMetric()));
134 ui.cbCenterMetric->setCurrentIndex(index);
135
136 updatePlotRangeList();
137
138 // Slots
139 // General-tab
140 connect(m_plot, &RunChart::dataColumnChanged, this, &RunChartDock::plotDataColumnChanged);
141 connect(m_plot, &RunChart::centerMetricChanged, this, &RunChartDock::plotCenterMetricChanged);
142}
143
144void RunChartDock::retranslateUi() {
145 ui.cbCenterMetric->clear();

Callers

nothing calls this directly

Calls 12

setLinesMethod · 0.80
setAspectMethod · 0.80
setCurrentModelIndexMethod · 0.80
QModelIndexClass · 0.50
dataLineMethod · 0.45
dataSymbolMethod · 0.45
centerLineMethod · 0.45
setSymbolsMethod · 0.45
sizeMethod · 0.45
setEnabledMethod · 0.45
isVisibleMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected