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

Method updateContent

src/frontend/datasources/XLSXOptionsWidget.cpp:39–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void XLSXOptionsWidget::updateContent(XLSXFilter* filter, const QString& fileName) {
40 DEBUG(Q_FUNC_INFO)
41 ui.twDataRegions->clear();
42 auto* rootItem = ui.twDataRegions->invisibleRootItem();
43 filter->parse(fileName, rootItem);
44
45 ui.twDataRegions->insertTopLevelItem(0, rootItem);
46 ui.twDataRegions->expandAll();
47
48 // select first data range
49 auto items = ui.twDataRegions->selectedItems();
50 if (items.size() == 0) {
51 const auto* tli = ui.twDataRegions->topLevelItem(0);
52 for (int i = 0; i < tli->childCount(); i++) { // sheets
53 const auto* sheet = tli->child(i);
54 if (sheet->childCount() > 0) { // select first range
55 ui.twDataRegions->setCurrentItem(sheet->child(0));
56 return;
57 }
58 }
59 }
60}
61
62void XLSXOptionsWidget::dataRegionSelectionChanged() {
63 DEBUG(Q_FUNC_INFO)

Callers

nothing calls this directly

Calls 7

expandAllMethod · 0.80
selectedItemsMethod · 0.80
clearMethod · 0.45
parseMethod · 0.45
sizeMethod · 0.45
childCountMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected