| 253 | } |
| 254 | |
| 255 | QTextBlock CodeEditor::blockAtPosition(int y) const |
| 256 | { |
| 257 | auto block = firstVisibleBlock(); |
| 258 | if (!block.isValid()) |
| 259 | return QTextBlock(); |
| 260 | |
| 261 | int top = blockBoundingGeometry(block).translated(contentOffset()).top(); |
| 262 | int bottom = top + blockBoundingRect(block).height(); |
| 263 | do { |
| 264 | if (top <= y && y <= bottom) { |
| 265 | return block; |
| 266 | } |
| 267 | block = block.next(); |
| 268 | top = bottom; |
| 269 | bottom = top + blockBoundingRect(block).height(); |
| 270 | } while (block.isValid()); |
| 271 | return QTextBlock(); |
| 272 | } |
| 273 | |
| 274 | bool CodeEditor::isFoldable(const QTextBlock &block) const |
| 275 | { |
no test coverage detected