qt - How to select a table using QTextCursor -


I hope this code should work but it

  QTextCursor cursor = textEdit- & Gt; textCursor (); Cursor = qtextcursor (cursor.currentFrame ()); CursorMyPoPy (QTextCursor :: EndOfBlock, QTextCursor :: KeepAnchor); textEdit-> SetTextCursor (cursor); TextEdit-> Copy (); // Here I have only found the text from the current cell, no table    

QTextTable cells A QTextEdit or QTextDocument itself is presented by a QTextBlock.

Your example code is actually moving the position of the cursor at the end of the existing block, which is the end of the contents of the cell.

You have to select all the cells to select the entire contents of the table.

This should work:

  cursor.movepositions (quotedScursor :: Start); While (cursor.movepozy (QTextCursor :: NextCell, QTextCursor :: KeepAnchor)) // // Break condition as a failure after Ann iterations? }   

Note that you can select the selection:

  cursor.edited text ();    

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

Simple file compression in C -

php - Sorting an multidimension array using usort fails -