html += QLatin1String(" font-size:");
html += QString::number(format.intProperty(QTextFormat::FontPixelSize));
html += QLatin1String("px;");
+ attributesEmitted = true;
}
if (format.hasProperty(QTextFormat::FontWeight)
void copiedFontSize();
+ void QTBUG25778_pixelSizeFromHtml();
+
void htmlExportImportBlockCount();
private:
QCOMPARE(rec.first, QString("contentsChanged"));
}
+void tst_QTextDocument::QTBUG25778_pixelSizeFromHtml()
+{
+ QTextDocument document1;
+ QTextDocument document2;
+
+ document1.setHtml("<span style=\"font-size: 24px\">Foobar</span>");
+ document2.setHtml(document1.toHtml());
+
+ QTextCursor cursor(&document2);
+ QCOMPARE(cursor.charFormat().font().pixelSize(), 24);
+}
+
void tst_QTextDocument::copiedFontSize()
{
QTextDocument documentInput;