Quote Originally Posted by Claymore View Post
Does anyone know what HTML tags are properly supported with the setHTML() function provided by the QGraphicsTextItem class? I've read up on Qt 4.2.0's support of HTML tags, but it only seems to apply to objects that use Rich Text.
It applies to all objects using QTextDocument, probably including QGraphicsTextItem.

My problem is that I would like to render some text in a scene, but have it be centered instead of left-justified (seems to be the default). Here's an example of the text I'd like to display:

Qt Code:
  1. QString text = "<center>Some<br/>Centered<br/>Text</center>";
  2. setHTML(text);
To copy to clipboard, switch view to plain text mode 
The displayed text shows up with the appropriate line breaks, but it isn't centered. Any help is very much appreciated.
Did you try:
Qt Code:
  1. QString text = "<div align='center'>Some<br/>centred<br/>text</div>";
To copy to clipboard, switch view to plain text mode 

Maybe QTextDocument supports it...