Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.4
-
None
-
Windows 7
-
3fe242781e88224d121ebca730db5ebe4fb98ec6
Description
With following code snippet QTextDocument::toHtml does not include line-height tag. When setting the tag with html to QTextDocument line-height is correct.
#include <QTextDocument> #include <QApplication> #include <QMessageBox> #include <QDebug> int main(int argc, char* argv[]) { QApplication app(argc, argv); const QString htmlIn("<html><head><style type='text/css'>body { line-height: 200%; }</style></head><body><p>testing the line height</p><p>second paragraph at 200%<p></body></html>"); qDebug() << "Input:" << htmlIn; QMessageBox::information(0, "Input HTML with line-height", htmlIn); QTextDocument doc; doc.setHtml(htmlIn); QString fromDoc = doc.toHtml(); qDebug() << fromDoc; QMessageBox::information(0, "Doc HTML loss line-height", fromDoc); return 0; }