PDA

View Full Version : Is QTextBlockFormat::setIndent() buggy? (Qt 5.3.2, KDE Debian 8)



Radek
11th June 2015, 16:53
QTextCursor cu(textCursor());
QTextBlockFormat aux;

aux.setIndent(1);
cu.insertBlock();
cu.mergeBlockFormat(aux);
cu.insertText("blah blah blah");

This "works" but the indent is unacceptably huge :confused: Even if the setIndent() argument is the smallest possible (the call has an int argument). Setting bigger indents shifts the text out of the editor window soon. Can someone more experienced verify it and evaluate, whether it is really a bug?

Note that other similar calls (setting margins, setTextIndent() ) have qreal arguments and behave much better. Replacing setIndent() by setLeftMargin() fixes the problem - but I wanted the text indented, not the block displaced.