Hi guys,

I'm working on a print module for my application but I'm kinda stuck here.
Short sketch:

I want to print my Qwt plot. BUT I need "header data" on my page to be printed. I want this data to be nicely added on top of the page into a table containing multiple collumns and rows. This table containing specific data will be generated into a QStringList containing html code for the table and data. This HTML code will be added to a QTextDocument that will be printed (QTextDocument:rint()).

Now the next step would be to add a QImage rendered from my QwtPlot (I'm using version 5.2.1 so the print function from v6 can not be used). The rendering of the image of the plot is simple. This image can also be printed apart from my QTextDocument, but now comes my problem.

I want to add beneath my header table data my plot. So at the top of the page, there will be a table, and below that table will be my plot. So summarized: I have a QTextDocument containing HTML code for the table and a QImage containing my plot. Now what I want to do is add my QImage to my HTML code. Like this, my QTextDocument will handle all the page breaking et cetera.

So how can I add my QImage to my excisting html code?

For instance: I can not do this:

QImage myImage = blablabla;
QString html = "<table width=\"100\" border=1 cellspacing=0>\n"
"<tr><td><b>" + title + "</b><tr><td>" + image +
"\n</table<\n<br>\n"

QTextDocument txtDoc;
txtDoc.setHtml(html);
txtDoc.print(printer);

Trying to do for instance + image will not work. Is there any way I can do "<img src=" + image " /> or add an image to the html code ? Or adding not only the html code but also the image to the QTextDocument and how will I then be able to control the layout?

My last option would be creating a hidden folder where I could save my QImage as a .jpg for example and then I could use the html code <img src="image.jp" /> but I'm not verry fond of using this option.