Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Nested List support in QTextEdit

$
0
0
Hi, I’m trying to create the nested list using QTextEdit. I tried with the below code snippet, but I’m getting the same number for all the blocks. QTextListFormat listFormat;        listFormat.setIndent(indent);        listFormat.setStyle(QTextListFormat::ListDecimal);           const vector<int> cursorPositions = iter->getPositions();         vector<int>::const_iterator posIter = cursorPositions .begin();         vector<int>::const_iterator posIterEnd = cursorPositions .end();         cursor.beginEditBlock();         for(; posIter!= posIterEnd; posIter++)         {             cursor.setPosition(*posIter);             cursor.insertList(listFormat);          }         cursor.endEditBlock() What is wrong in the above code snippet? I already came across the below post which is about 2 years old. http://qt-project.org/forums/viewthread/10062 Can someone provide me the input?

Viewing all articles
Browse latest Browse all 13965

Trending Articles