MCPcopy Create free account
hub / github.com/baldurk/renderdoc / visualIndexAt

Method visualIndexAt

qrenderdoc/Widgets/Extended/RDHeaderView.cpp:224–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224int RDHeaderView::visualIndexAt(int position) const
225{
226 if(m_customSizing)
227 {
228 if(m_sections.isEmpty())
229 return -1;
230
231 if(position >= m_pinnedWidth)
232 position += offset();
233
234 SectionData search;
235 search.offset = position;
236 auto it = std::lower_bound(
237 m_sections.begin(), m_sections.end(), search,
238 [](const SectionData &a, const SectionData &b) { return a.offset <= b.offset; });
239
240 if(it != m_sections.begin())
241 --it;
242
243 if(it->offset <= position &&
244 position < (it->offset + it->size + (it->groupGap ? groupGapSize() : 0)))
245 return (it - m_sections.begin());
246
247 return -1;
248 }
249
250 return QHeaderView::visualIndexAt(position);
251}
252
253int RDHeaderView::logicalIndexAt(int position) const
254{

Callers 4

columnAtMethod · 0.80
paintEventMethod · 0.80
scrollToMethod · 0.80
updateGeometriesMethod · 0.80

Calls 4

offsetFunction · 0.85
isEmptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected