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

Method index

src/backend/datasources/filters/QJsonModel.cpp:296–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296QModelIndex QJsonModel::index(int row, int column, const QModelIndex& parent) const {
297 if (!hasIndex(row, column, parent))
298 return QModelIndex{};
299
300 QJsonTreeItem* parentItem;
301
302 if (!parent.isValid())
303 parentItem = mHeadItem;
304 else
305 parentItem = static_cast<QJsonTreeItem*>(parent.internalPointer());
306
307 QJsonTreeItem* childItem = parentItem->child(row);
308 if (childItem)
309 return createIndex(row, column, childItem);
310
311 return {};
312}
313
314QModelIndex QJsonModel::parent(const QModelIndex& index) const {
315 if (!index.isValid())

Callers 1

prepareDocumentToReadMethod · 0.45

Calls 2

isValidMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected