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

Method fragmentCursor

MiniZincIDE/outputwidget.cpp:779–795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779QTextCursor OutputWidget::fragmentCursor(int position)
780{
781 if (position != -1) {
782 auto cursor = ui->textBrowser->textCursor();
783 cursor.setPosition(position);
784 auto block = cursor.block();
785 for (auto it = block.begin(); it != block.end(); it++) {
786 auto fragment = it.fragment();
787 if (fragment.contains(position)) {
788 cursor.setPosition(fragment.position());
789 cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, fragment.length());
790 return cursor;
791 }
792 }
793 }
794 return QTextCursor();
795}
796
797bool OutputWidget::eventFilter(QObject* object, QEvent* event)
798{

Callers

nothing calls this directly

Calls 3

containsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected