QTextEdit: How to create nested lists starting on level 2?
-
Hi,
I'm desperately trying to create a QTextDocument with the following structure using the QTextCursor interface.
@
* level two
* level one
@So basically I want the list to start one level 2 and then continue one level 1.
The problem seems to be that it is not possible to create a sub-list on an empty list-item. The following code will create a visually correct item on the second level, but the structure of QDocument shows that it is in fact still on the first level. Only indented twice.
@
QTextListFormat listFormat;
listFormat.setStyle(QTextListFormat::ListDisc);// First level
listFormat.setIndent(1);
cursor.createList(listFormat);// Second level
listFormat.setIndent(2);
cursor.createList(listFormat);
@If anyone has ideas how to implement that, please let me know!
Thanks!
Conny