In the html-list with marks, when changing fontsize using format.setFontPointSize (), it crashes from the editor from the command line. I realized that the bullets stay in the same position when changing fontsize, if I set padding-left to 1em (I tried this in the html editor). How can I achieve this to write a list in Qt? Can I only set a pixel value, not an element value?
fmt=cur.charFormat() charSize=fmt.fontPointSize() if charSize==0.0: charSize=14 if direction=="up": fmt.setFontPointSize(charSize+1) if textList: blockFormat=cur.blockFormat() #blockFormat.setLeftMargin(blockFormat.leftMargin()+0.4) blockFormat.setLeftMargin(1em) cur.mergeBlockFormat(blockFormat) else: fmt.setFontPointSize(charSize-1) if textList: blockFormat=cur.blockFormat() #blockFormat.setLeftMargin(blockFormat.leftMargin()-0.4) blockFormat.setLeftMargin(1em) cur.mergeBlockFormat(blockFormat) cur.mergeCharFormat(fmt)
source share