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

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -