[WIKI][/WIKI]If you use the code from your last post it is normal that there is no picture.
The widget doesn't have a size and there is nothing to show
try this code
wid->setGeometry(0,0,200,200);
QPixmap pixmap
(wid
->rect
().
size());
pixmap.save("D:/test.png");
scroll = new QScrollArea();
wid = new QWidget(scroll);
btn = new QPushButton("test",wid);
wid->setGeometry(0,0,200,200);
layout = new QHBoxLayout(wid);
QPixmap pixmap(wid->rect().size());
wid->render(&pixmap,QPoint(),QRegion(wid->rect()));
pixmap.save("D:/test.png");
To copy to clipboard, switch view to plain text mode
Bookmarks