| 41 | } |
| 42 | |
| 43 | void 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 | |
| 71 | void JsonOptionsWidget::clearModel() { |
| 72 | m_model->clear(); |
nothing calls this directly
no test coverage detected