MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / index

Method index

ElaWidgetTools/DeveloperComponents/ElaNavigationModel.cpp:70–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70QModelIndex ElaNavigationModel::index(int row, int column, const QModelIndex& parent) const
71{
72 if (!hasIndex(row, column, parent))
73 {
74 return {};
75 }
76 ElaNavigationNode* parentNode;
77 if (!parent.isValid())
78 {
79 parentNode = _rootNode;
80 }
81 else
82 {
83 parentNode = static_cast<ElaNavigationNode*>(parent.internalPointer());
84 }
85 ElaNavigationNode* childNode = nullptr;
86 if (parentNode->getChildrenNodes().count() > row)
87 {
88 if (parentNode == _rootNode && !_isMaximalMode)
89 {
90 childNode = parentNode->getExceptCategoryNodes().at(row);
91 }
92 else
93 {
94 childNode = parentNode->getChildrenNodes().at(row);
95 }
96 }
97 if (childNode)
98 {
99 childNode->setModelIndex(createIndex(row, column, childNode));
100 return childNode->getModelIndex();
101 }
102 return {};
103}
104
105int ElaNavigationModel::rowCount(const QModelIndex& parent) const
106{

Callers 6

getIndexFromDateMethod · 0.45
addFooterNodeMethod · 0.45
_scrollToDateMethod · 0.45
_refreshCurrentIndexsMethod · 0.45
_initNodeModelIndexMethod · 0.45

Calls 2

countMethod · 0.80

Tested by

no test coverage detected