The function int QTextFormat::objectIndex () const returnes an object index. What is it? And what if I do the following:
QTextBlockFormat bfmt;
bfmt.setObjectIndex(0);
What this code does?
ADDED: Here there is a function void TextEdit::textStyle(int styleIndex). This function is for adding a list into QTextEdit, or making it a normal (standard text). In the function mentioned above there is a code snippet like this:
} else {
// ####
QTextBlockFormat bfmt;
bfmt.setObjectIndex(-1);
cursor.mergeBlockFormat(bfmt);
}
This code snippet is in order to make list a standard text. But it does not work and only works when I write
QTextBlockFormat bfmt;
bfmt.setObjectIndex(0);
m_textCursor.mergeBlockFormat(bfmt);
m_textEdit->setTextCursor(m_textCursor);
Please explain me why?