PDA

View Full Version : problem with ported canvas example



bajarangi
29th July 2009, 20:57
Hi all,

I was trying to use a loaded image on a QT4 GraphicScene in my own code,
and had some problems, so I started working with the Ported Canvas
example to understand a minimum function.

I found what looks like a problem with that example.
In the ImageItem constructor, if I leave the QT3 API as
it is:
pixmap.convertFromImage(image);

The butterfly image displays successfully.

If I try to convert that call to the QT4 api like this:
pixmap.fromImage(image);

The butterfly images do not display.
The rest of the code is the same, and there are no
compile time or run time warnings or errors.

I'm really stumped.:confused:
Please help!

-Don

wysota
29th July 2009, 21:26
QPixmap::fromImage() is a static call returning a pixmap, You have to assign the result to a pixmap variable.

bajarangi
29th July 2009, 23:30
Thanks Wysotta!

Of course it now works fine.

I pledge to read the API documentation more carefully in the future.:o

-Don