| 222 | } |
| 223 | |
| 224 | int 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 | |
| 253 | int RDHeaderView::logicalIndexAt(int position) const |
| 254 | { |
no test coverage detected