Add an indentation in HTML with QTextDocument in Qt -


i'm trying print tree widget in pdf document qt.

i use qtextdocument , method sethtml before printing. problem keep same design in pdf document, don't know how add indentation in html. i've tried <span text-indent="10px">, it's not ok.

one simple way of doing in html add 1 or more &nbsp; (non-breakable space) in front of rows want indent.

for instance:

root<br> &nbsp;&nbsp;branch 1<br> &nbsp;&nbsp;branch 2<br> &nbsp;&nbsp;&nbsp;&nbsp;leaf<br> 

will give following result:

root
  branch 1
  branch 2
    leaf


Comments