| 768 | |
| 769 | |
| 770 | int OutputWidget::mouseToPosition(const QPoint& mousePos, Qt::HitTestAccuracy accuracy) |
| 771 | { |
| 772 | auto* hbar = ui->textBrowser->horizontalScrollBar(); |
| 773 | auto hOffset = isRightToLeft() ? (hbar->maximum() - hbar->value()) : hbar->value(); |
| 774 | auto vOffset = ui->textBrowser->verticalScrollBar()->value(); |
| 775 | auto* layout = ui->textBrowser->document()->documentLayout(); |
| 776 | return layout->hitTest(QPointF(mousePos.x() + hOffset, mousePos.y() + vOffset), accuracy); |
| 777 | } |
| 778 | |
| 779 | QTextCursor OutputWidget::fragmentCursor(int position) |
| 780 | { |