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

Method updatePlotRangeList

src/frontend/dockwidgets/BaseDock.cpp:88–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void BaseDock::updatePlotRangeList() {
89 auto* element{static_cast<WorksheetElement*>(m_aspect)};
90 if (!element) {
91 DEBUG(Q_FUNC_INFO << ", WARNING: no worksheet element!")
92 return;
93 }
94 const int cSystemCount{element->coordinateSystemCount()};
95 const int cSystemIndex{element->coordinateSystemIndex()};
96
97 if (cSystemCount == 0) {
98 DEBUG(Q_FUNC_INFO << ", WARNING: no plot range yet")
99 return;
100 }
101 DEBUG(Q_FUNC_INFO << ", plot ranges count: " << cSystemCount)
102 DEBUG(Q_FUNC_INFO << ", current plot range: " << cSystemIndex + 1)
103
104 if (!m_cbPlotRangeList) {
105 assert(false);
106 DEBUG(Q_FUNC_INFO << ", ERROR: no plot range combo box")
107 return;
108 }
109
110 // fill ui.cbPlotRanges
111 m_suppressPlotRetransform = true;
112 m_cbPlotRangeList->clear();
113 for (int i{0}; i < cSystemCount; i++)
114 m_cbPlotRangeList->addItem(QString::number(i + 1) + QStringLiteral(" : ") + element->coordinateSystemInfo(i));
115 m_cbPlotRangeList->setCurrentIndex(cSystemIndex);
116 m_suppressPlotRetransform = false;
117
118 // disable when there is only on plot range
119 m_cbPlotRangeList->setEnabled(cSystemCount == 1 ? false : true);
120}
121
122//*************************************************************
123//******* SLOTs for changes triggered in the dock widget *****

Callers

nothing calls this directly

Calls 6

coordinateSystemIndexMethod · 0.80
coordinateSystemInfoMethod · 0.80
coordinateSystemCountMethod · 0.45
clearMethod · 0.45
setCurrentIndexMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected