Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, July 2007
[Fwd: Re: QWidget render problem ?]


Message 1 in thread

Andreas Pakulat wrote:
> On 12.07.07 18:50:26, BogDan Vatra wrote:
>> Hi All,
>>
>>  I think i found a bug in render method of QWidget object
>> (http://doc.trolltech.com/4.3/qwidget.html#render).
>>  I attach an exemple.
>>  See before.png and after.png.
>
> Sorry, forget my first mail :)
>
> Anyway, there's no mentioning in the render() function that it works
> without showing the widget first.
>
> I don't think you can get around the show() (or setVisible(true))
>
> Andreas
>

Thans for your response,

The render() function is useless if it don't work with widget hidden.

I don't this is the problem, I made another example and the QWidget seem
to render corectly:

#include <QApplication>
#include <QPixmap>
#include <QDialog>
#include <QPushButton>

int main(int argc, char**argv)
{
    QApplication app(argc,argv);
    QDialog d;
    QPushButton b("ok",&d);

    QPixmap pd(d.size());
    d.render(&pd);
    pd.save("dialog.png"); // d is hidden !!!

    QPixmap pb(b.size());
    b.render(&pb);
    pb.save("button.png"); // b is hidden !!!

    return d.exec();
}




--
 [ signature omitted ]