MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / mouseToPosition

Method mouseToPosition

MiniZincIDE/outputwidget.cpp:770–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768
769
770int 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
779QTextCursor OutputWidget::fragmentCursor(int position)
780{

Callers

nothing calls this directly

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected