Generate HTML using Qt

1.9k views Asked by At

I try to programmatically generate HTML using Qt 5.7 and C++.

I would like to avoid using simple text streaming since this does not check HTML syntax.

I tried to use QTextDocument and toHtml() but it seems not to work very well. It generally supports a small HTML subset only and a lot of standard elements must still be coded into strings manually.

Is there a clean way to generate HTML code using Qt/C++? Maybe some class that does for HTML what QDomDocument does for XML?

1

There are 1 answers

0
Silicomancer On BEST ANSWER

I ended creating my own template and DOM bases template classes supporting the HTML subset I need.