[Qt-interest] Render hidden widget to QPixmap

Girish Ramakrishnan girish at forwardbias.in
Tue Feb 9 05:27:39 CET 2010


Liebe Markus (RtP2/TEF72) wrote:
> Hi there,
>  
> I want to use Qwidget::render() to create a Pixmap containing the
> contents of a hidden Qwidget foo which was not shown on the screen before.
> This does not work for me. I figured out that I have to use foo->show()
> to display the widget on the screen before I am able to render the
> contents to the Qpixmap.
> Otherwise I do not get a Qpixmap with the correct contents, it is just
> plain gray….
>  

QWidget::render() is supposed to work on hidden widgets. If it doesn't
please report a bug in the Qt tracker.

As a work around, maybe you can display your widget somewhere outside
the screen and then call render :-) ?

Girish



More information about the Qt-interest-old mailing list