I use QTextEdit as HTML editor for templates in my application.
So, when I save resulted HTML structure via toHtml() I get string looked like a garbage. QTextEdit inserts style to every tag. for example if I press enter new paragraph looks like
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Some text</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Some text</p>
To copy to clipboard, switch view to plain text mode
There is sence to add style to formatted text, for example, if I set text to "bold", result looks like
<p style=" font-weight:600;">Bolded text</p>
<p style=" font-weight:600;">Bolded text</p>
To copy to clipboard, switch view to plain text mode
but for what it inserts styles to paragraph without format?
So my question - is there way to get "clean" HTML, without unwanted styles?
Bookmarks