Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.3.0, 5.4.0, 5.5.0
-
None
-
Debian Linux Jessie x86-64, gcc 4.9.2
Description
Run the following program:
#include "mainwindow.h" #include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPlainTextEdit te; te.setPlainText("abcabc\ndefdef"); QTextCursor cursor = te.textCursor(); cursor.select(QTextCursor::Document); QTextBlockFormat fmt; fmt.setLineHeight(100, QTextBlockFormat::FixedHeight); cursor.setBlockFormat(fmt); te.show(); return a.exec(); }
The line height of the fonts will be used instead of the explicitly set line height in the block format, since the QPlainTextEditLayout never actually checks the block format's line height. Replacing QPlainTextEdit with QTextEdit shows the expected result.