MCPcopy Create free account
hub / github.com/KDAB/KDChart / mapFromSource

Method mapFromSource

src/KDChart/KDChartAbstractProxyModel.cpp:45–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43};
44
45QModelIndex AbstractProxyModel::mapFromSource(const QModelIndex &sourceIndex) const
46{
47 if (!sourceIndex.isValid())
48 return QModelIndex();
49 // qDebug() << "sourceIndex.model()="<<sourceIndex.model();
50 // qDebug() << "model()="<<sourceModel();
51 Q_ASSERT(sourceIndex.model() == sourceModel());
52
53 // Create an index that preserves the internal pointer from the source;
54 // this way AbstractProxyModel preserves the structure of the source model
55 return createIndex(sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer());
56}
57
58QModelIndex AbstractProxyModel::mapToSource(const QModelIndex &proxyIndex) const
59{

Callers

nothing calls this directly

Calls 5

rowMethod · 0.80
QModelIndexClass · 0.50
isValidMethod · 0.45
modelMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected