qtpyqtqtextcursor

QTextTable move QTextCursor to a determinated Cell


I have a QTextTable, I do some actions in the table and I want two things:

How can I do?


Solution

  • For the given table object of type QTextTable get desired cursor:

    auto tableCell = table->cellAt(row, column);
    auto cursor = tableCell.firstCursorPosition();
    

    then setTextCursor within edited QTextEdit object.