Ginsengelf
10th February 2011, 15:30
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:
QTextFrameFormat oLineFormat;
oLineFormat.setHeight (1);
oLineFormat.setWidth (100);
oLineFormat.setBorderStyle (QTextFrameFormat::BorderStyle_Solid);
oDocumentCursor.insertFrame (oLineFormat);
oDocumentCursor.insertText (" ");
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
I tried to create an empty frame like this:
QTextFrameFormat oLineFormat;
oLineFormat.setHeight (1);
oLineFormat.setWidth (100);
oLineFormat.setBorderStyle (QTextFrameFormat::BorderStyle_Solid);
oDocumentCursor.insertFrame (oLineFormat);
oDocumentCursor.insertText (" ");
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