qt - Printing really huge image on plotter using QPrinter -


i have print on plotter world map lot of vector data on qt based app. plotter has 80 gb hard drive, print high resolution images. data loaded in qgraphicsscene.

qgraphicsscene *scene;  .....  qprinter *printer = new qprinter(qprinter::screenresolution); printer->setpapersize(qprinter::a4);  qpainter painter(printer); painter.setrenderhint(qpainter::antialiasing); 

a4 using improve speed during tests.

forever {    if(printedheight >= sceneheight)    {        isprintingrunning = false;        qdebug() << "printing finished";        break;    }     ...loading next tile strip     scene->render(&painter, topage(scenerect), tilestriprect);    scene->clearstrip;    printedheight += stripheight; } 

after loading vector data, i'm loading tiles(256x256 px) horizontal strips, render strip painter, clear tiles scene, again. because i'm rendering strips scene doesn't exceed available memory, qpainter doesn't send data printer until deleted, that's why app run out of memory. there opportunity call qpainter::end() each cycle step, in way each strip printed on differrent page on ordinary printer, suppose plotter cut each strip, can't control plotter's knife. not solution. how can force qpainter send data , clear cache, stay in same print session?


Comments