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

Method setChildSelectedInView

src/backend/core/Workbook.cpp:151–166  ·  view source on GitHub ↗

! * Emits the signal to select or to deselect the workbook item (spreadsheet or matrix) with the index \c index * in the project explorer, if \c selected=true or \c selected=false, respectively. * The signal is handled in \c AspectTreeModel and forwarded to the tree view in \c ProjectExplorer. * This function is called in \c WorkbookView when the current tab was changed */

Source from the content-addressed store, hash-verified

149 * This function is called in \c WorkbookView when the current tab was changed
150 */
151void Workbook::setChildSelectedInView(int index, bool selected) {
152 auto* aspect = child<AbstractAspect>(index);
153 if (selected) {
154 Q_EMIT childAspectSelectedInView(aspect);
155
156 // deselect the workbook in the project explorer, if a child (spreadsheet or matrix) was selected.
157 // prevents unwanted multiple selection with workbook if it was selected before.
158 Q_EMIT childAspectDeselectedInView(this);
159 } else {
160 Q_EMIT childAspectDeselectedInView(aspect);
161
162 // deselect also all children that were potentially selected before (columns of a spreadsheet)
163 for (auto* child : aspect->children<AbstractAspect>())
164 Q_EMIT childAspectDeselectedInView(child);
165 }
166}
167
168QVector<AspectType> Workbook::pasteTypes() const {
169 return QVector<AspectType>{AspectType::Spreadsheet, AspectType::Matrix};

Callers 2

tabChangedMethod · 0.45
tabChangedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected