! * Emits the signal to select or to deselect the column number \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 SpreadsheetView upon selection changes. */
| 1178 | * This function is called in \c SpreadsheetView upon selection changes. |
| 1179 | */ |
| 1180 | void Spreadsheet::setColumnSelectedInView(int index, bool selected) { |
| 1181 | if (selected) { |
| 1182 | Q_EMIT childAspectSelectedInView(child<Column>(index)); |
| 1183 | |
| 1184 | // deselect the spreadsheet in the project explorer, if a child (column) was selected |
| 1185 | // and also all possible parents like folder, workbook, datapicker curve, datapicker |
| 1186 | // to prevents unwanted multiple selection in the project explorer |
| 1187 | // if one of the parents of the selected column was also selected before. |
| 1188 | AbstractAspect* parent = this; |
| 1189 | while (parent) { |
| 1190 | Q_EMIT childAspectDeselectedInView(parent); |
| 1191 | parent = parent->parentAspect(); |
| 1192 | } |
| 1193 | } else |
| 1194 | Q_EMIT childAspectDeselectedInView(child<Column>(index)); |
| 1195 | } |
| 1196 | |
| 1197 | QVector<AspectType> Spreadsheet::pasteTypes() const { |
| 1198 | return QVector<AspectType>{AspectType::Column}; |
no test coverage detected