Yes, it's perfectly possible. The question was posted years ago, but I'm replying for future references.
To remove a list from a text block, you must call the list's remove() function, passing the block as a parameter. The example below shows how you could do that:
//let textEdit be your QTextEdit object. get its text cursor
//get the cursor's current list, which you want to remove from the text.
QTextList* currentList
= cursor.
currentList();
//get the current block, which you want to remove from the current list
//call the list's remove() function, passing the block as a parameter
currentList->remove(currentBlock);
//the list is now removed, but you still have to remove the list identation
blockFormat.setIndent(0);
cursor.setBlockFormat(blockFormat);
//let textEdit be your QTextEdit object. get its text cursor
QTextCursor cursor = textEdit->textCursor();
//get the cursor's current list, which you want to remove from the text.
QTextList* currentList = cursor.currentList();
//get the current block, which you want to remove from the current list
QTextBlock currentBlock = cursor.block();
//call the list's remove() function, passing the block as a parameter
currentList->remove(currentBlock);
//the list is now removed, but you still have to remove the list identation
QTextBlockFormat blockFormat = cursor.blockFormat();
blockFormat.setIndent(0);
cursor.setBlockFormat(blockFormat);
To copy to clipboard, switch view to plain text mode
Bookmarks