Advertisement
Guest User

Untitled

a guest
Oct 14th, 2011
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. What happens: Inserting html generated by qml textarea to QTextDocument and converting it back to html makes it change font settings
  2.  
  3. Code:
  4. QTextDocument document;
  5. document.setHtml(d->inputText);
  6.  
  7. qDebug() << d->inputText;
  8. qDebug() << "------------";
  9. qDebug() << document.toHtml();
  10.  
  11.  
  12. Output:
  13. "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
  14. <html><head><meta name="qrichtext" content="1" /><style type="text/css">
  15. p, li { white-space: pre-wrap; }
  16. </style></head><body style=" font-family:'Nokia Pure Text'; font-weight:400; font-style:normal;">
  17. <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>"
  18. ------------
  19. "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
  20. <html><head><meta name="qrichtext" content="1" /><style type="text/css">
  21. p, li { white-space: pre-wrap; }
  22. </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
  23. <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>"
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement