Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What happens: Inserting html generated by qml textarea to QTextDocument and converting it back to html makes it change font settings
- Code:
- QTextDocument document;
- document.setHtml(d->inputText);
- qDebug() << d->inputText;
- qDebug() << "------------";
- qDebug() << document.toHtml();
- Output:
- "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
- <html><head><meta name="qrichtext" content="1" /><style type="text/css">
- p, li { white-space: pre-wrap; }
- </style></head><body style=" font-family:'Nokia Pure Text'; font-weight:400; font-style:normal;">
- <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Alf</p></body></html>"
- ------------
- "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
- <html><head><meta name="qrichtext" content="1" /><style type="text/css">
- p, li { white-space: pre-wrap; }
- </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
- <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Nokia Pure Text';">Alf</span></p></body></html>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement