Hi, I'm creating a QTextDocument and print it as PDF to a QPrinter with QTextDocument::print (). I can create text and tables, but I would like to insert a simple horizontal line to separate some paragraphs.

I tried to create an empty frame like this:
Qt Code:
  1. QTextFrameFormat oLineFormat;
  2. oLineFormat.setHeight (1);
  3. oLineFormat.setWidth (100);
  4. oLineFormat.setBorderStyle (QTextFrameFormat::BorderStyle_Solid);
  5. oDocumentCursor.insertFrame (oLineFormat);
  6. oDocumentCursor.insertText (" ");
To copy to clipboard, switch view to plain text mode 
but it did not shown up in my printed PDF.

I read the text object example, but do I really have to create my own TextObject for this? Or is there a simpler way to draw a line?

Ginsengelf