PDA

View Full Version : Insert QwtPlot inside QTextDocument...difficult to do



giusepped
4th November 2009, 06:12
Apparently, what I state in the title is not yet possible:



QPainter p;
int pw = printer->pageRect().width();
int ph =printer->pageRect().height();
p.setViewport(printer->pageRect());
printer->setPageSize(QPrinter::A4);
p.begin(printer);


m_document->setPageSize(printer->pageRect().size());
m_document->drawContents(&p);

printer->newPage();

QRect rec(-10,0.4*ph,pw-10,0.6*ph);

if (solarDiagram)
solarDiagram->print(&p,rec,filter);



m_document has just a simple Html String.
The qwtPlot goes to the second page and it's visible. But the text on the first page is ultra-small. It seems that the painter is painting on a wrong rectangle,isnt'it?