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

Method testLinkSpreadsheetRemoveRow

tests/spreadsheet/SpreadsheetTest.cpp:2874–2913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2872}
2873
2874void SpreadsheetTest::testLinkSpreadsheetRemoveRow() {
2875#ifdef __FreeBSD__
2876 return;
2877#endif
2878 Project project;
2879 auto* sheetData = new Spreadsheet(QStringLiteral("data"), false);
2880 project.addChild(sheetData);
2881 sheetData->setColumnCount(3);
2882 sheetData->setRowCount(10);
2883
2884 auto* sheetCalculations = new Spreadsheet(QStringLiteral("calculations"), false);
2885 project.addChild(sheetCalculations);
2886 sheetCalculations->setColumnCount(3);
2887 sheetCalculations->setRowCount(2);
2888
2889 SpreadsheetDock dock(nullptr);
2890 dock.setSpreadsheets({sheetCalculations});
2891
2892 QCOMPARE(dock.ui.cbLinkingEnabled->isChecked(), false);
2893 QCOMPARE(dock.ui.cbLinkedSpreadsheet->isVisible(), false);
2894 QCOMPARE(dock.ui.sbRowCount->isEnabled(), true);
2895 QCOMPARE(sheetCalculations->linking(), false);
2896
2897 dock.ui.cbLinkingEnabled->toggled(true);
2898
2899 sheetCalculations->setLinkedSpreadsheet(sheetData);
2900
2901 QCOMPARE(sheetCalculations->linking(), true);
2902 QCOMPARE(sheetCalculations->linkedSpreadsheet(), sheetData);
2903 QCOMPARE(sheetCalculations->linkedSpreadsheetPath(), sheetData->path());
2904 QCOMPARE(sheetCalculations->rowCount(), 10);
2905
2906 new SpreadsheetModel(sheetData); // otherwise emitRowCountChanged will not be called
2907 sheetData->setRowCount(7);
2908
2909 QCOMPARE(sheetCalculations->linking(), true);
2910 QCOMPARE(sheetCalculations->linkedSpreadsheet(), sheetData);
2911 QCOMPARE(sheetCalculations->linkedSpreadsheetPath(), sheetData->path());
2912 QCOMPARE(sheetCalculations->rowCount(), 7);
2913}
2914
2915void SpreadsheetTest::testLinkSpreadsheetRecalculate() {
2916#ifdef __FreeBSD__

Callers

nothing calls this directly

Calls 9

setLinkedSpreadsheetMethod · 0.80
linkedSpreadsheetPathMethod · 0.80
addChildMethod · 0.45
setColumnCountMethod · 0.45
setRowCountMethod · 0.45
setSpreadsheetsMethod · 0.45
isVisibleMethod · 0.45
pathMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected