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

Method applyFilterSettings

src/frontend/datasources/JsonOptionsWidget.cpp:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void JsonOptionsWidget::applyFilterSettings(JsonFilter* filter, const QModelIndex& index) const {
44 Q_ASSERT(filter);
45
46 filter->setModel(m_model);
47 filter->setModelRows(getIndexRows(index));
48
49 QLocale::Language lang;
50 if (ui.cbDecimalSeparator->currentIndex() == 0)
51 lang = QLocale::Language::C;
52 else
53 lang = QLocale::Language::German;
54 filter->setNumberFormat(lang);
55
56 filter->setDateTimeFormat(ui.cbDateTimeFormat->currentText());
57 filter->setCreateIndexEnabled(ui.chbCreateIndex->isChecked());
58 filter->setNaNValueToZero(ui.chbConvertNaNToZero->isChecked());
59 filter->setImportObjectNames(ui.chbImportObjectNames->isChecked());
60
61 // TODO: change this after implementation other row types
62 filter->setDataRowType(QJsonValue::Array);
63 if (!index.isValid())
64 return;
65 auto* item = static_cast<QJsonTreeItem*>(index.internalPointer());
66 if (item->childCount() < 1)
67 return;
68 filter->setDataRowType(item->child(0)->type());
69}
70
71void JsonOptionsWidget::clearModel() {
72 m_model->clear();

Callers

nothing calls this directly

Calls 14

currentTextMethod · 0.80
setImportObjectNamesMethod · 0.80
setModelMethod · 0.45
setModelRowsMethod · 0.45
currentIndexMethod · 0.45
setNumberFormatMethod · 0.45
setDateTimeFormatMethod · 0.45
setCreateIndexEnabledMethod · 0.45
setNaNValueToZeroMethod · 0.45
setDataRowTypeMethod · 0.45
isValidMethod · 0.45
childCountMethod · 0.45

Tested by

no test coverage detected