QTextEdit remove list
-
wrote on 3 May 2023, 00:29 last edited by
I observe in QTextEdit there is a createList method, but what is its opposite?
Suppose I have a list item like so- fubar
And I want to convert that to a non-list-item paragraph.
How can I do that? -
@JonB I'm surprised someone hasn't thought to add this feature already.
Anyway removing and re-adding is what I'm trying now. I'm having some success.
wrote on 3 May 2023, 14:10 last edited by@clarify
Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against. -
I observe in QTextEdit there is a createList method, but what is its opposite?
Suppose I have a list item like so- fubar
And I want to convert that to a non-list-item paragraph.
How can I do that?wrote on 3 May 2023, 08:02 last edited by JonB 5 Mar 2023, 08:02@clarify said in QTextEdit remove list:
I observe in QTextEdit there is a createList method
There isn't.
There is for
QTextCursor
.At a guess, you would need to remove the blocks from the list, re-add them outside as plain paragraphs, and then remove the (now) empty list completely.
-
@clarify said in QTextEdit remove list:
I observe in QTextEdit there is a createList method
There isn't.
There is for
QTextCursor
.At a guess, you would need to remove the blocks from the list, re-add them outside as plain paragraphs, and then remove the (now) empty list completely.
-
@JonB I'm surprised someone hasn't thought to add this feature already.
Anyway removing and re-adding is what I'm trying now. I'm having some success.
wrote on 3 May 2023, 14:10 last edited by@clarify
Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against. -
@clarify
Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against.wrote on 3 May 2023, 14:55 last edited byThis post is deleted! -
@clarify
Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against. -
1/6