c++ - QT QTextEdit add spurious line -


look @ tiny piece of qt code

qdebug() << "content" << content;  qtextedit *te = new qtextedit(this); te->sethtml(content);  qdebug() << "content after " << te->tohtml(); 

content contains 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:'calibri'; font-size:10pt; font-weight:400; font-style:normal;\">         <p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">             <span style=\" font-family:'verdana'; color:#0b333c;\">my text</span>         </p>     </body> </html>" 

... output of te->tohtml() is...

<!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\">\np, li { white-space: pre-wrap; }\n</style>     </head>     <body style=\" font-family:'calibri'; font-size:10pt; 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;\"> </p>         <p style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">             <span style=\" font-family:'verdana'; color:#0b333c;\">my text</span>         </p>     </body> </html> 

as can see, qtextedit prepend paragraph no reason. annoying , need absolutely avoid it.

any ideas? can't figure out how rid of behaviour. bug?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -