I want to apply some custom stylesheet to a QTextDocument using setDefaultStyleSheet
function, however it get ignored.
According to this post i should add the style sheet after setting the html content, but this did not solve my problem.
My code:
QString *html = new QString();
*html = "<tr>" + name + "</tr>"
"<tr>" + surname + "</tr>"
"<tr>" + age + "</tr></table>";
QTextDocument doc;
doc.setHtml(*html);
doc.setDefaultStyleSheet("table { border: 1px solid black; }"); // This should apply the style sheet