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

Method mapFromSource

src/KDChart/KDChartDatasetProxyModel.cpp:76–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76QModelIndex DatasetProxyModel::mapFromSource(const QModelIndex &sourceIndex) const
77{
78 Q_ASSERT_X(sourceModel(), "DatasetProxyModel::mapFromSource", "A source "
79 "model must be set before the selection can be configured.");
80
81 if (!sourceIndex.isValid())
82 return sourceIndex;
83
84 if (mRowSrcToProxyMap.isEmpty() && mColSrcToProxyMap.isEmpty()) {
85 return createIndex(sourceIndex.row(), sourceIndex.column(),
86 sourceIndex.internalPointer());
87 } else {
88 int row = mapSourceRowToProxy(sourceIndex.row());
89 int column = mapSourceColumnToProxy(sourceIndex.column());
90 return createIndex(row, column, sourceIndex.internalPointer());
91 }
92}
93
94QModelIndex DatasetProxyModel::mapToSource(const QModelIndex &proxyIndex) const
95{

Callers 15

setRootIndexMethod · 0.45
calcPercentValueMethod · 0.45
pieAttributesMethod · 0.45
threeDPieAttributesMethod · 0.45
calcPercentValueMethod · 0.45
setRootIndexMethod · 0.45
setLineAttributesMethod · 0.45
resetLineAttributesMethod · 0.45
lineAttributesMethod · 0.45

Calls 4

rowMethod · 0.80
isValidMethod · 0.45
isEmptyMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected