There are N pixmaps, one associated with each widget in the layout.
I'm looking for a combined pixmap of all the widgets contained in the layout.
Of course I can write code to use QPainter to build it from each pixmap, eg (untested):
QImage *compositeImage
= new QImage(subImageWidth
*subImages.
count(),subImages
[0].
height(),
QImage::Format_RGB888);
QString fname
= fg
->getSaveFileName
();
for (int i=0;i<subImages.count();i++)
painter.drawImage(i*subImageWidth,0,subImages[i]);
compositeImage->save(fname);
delete compositeImage;
QImage *compositeImage = new QImage(subImageWidth*subImages.count(),subImages[0].height(),QImage::Format_RGB888);
QString fname = fg->getSaveFileName();
QPainter painter(compositeImage);
for (int i=0;i<subImages.count();i++)
painter.drawImage(i*subImageWidth,0,subImages[i]);
compositeImage->save(fname);
delete compositeImage;
To copy to clipboard, switch view to plain text mode
I'm asking if there's an easier/better way to do it in Qt4 like is done in Qt5.
Added after 50 minutes:
Rajesh, I dismissed your good suggestion too quickly. I'm sorry!
I read the documentation you pointed me too, and I think it is what I need.
I'll give it a try!
Thanks,
Dave Thomas
Bookmarks