[Solved] QImage.save() generates strange image files

I'm trying to make a very simple image creator, using PySide.
For now, my app can draw things. But it fails to save a image file.
According to the PySide documentation, using QImage.save() would result in the desired result. So, I wrote this script. It generates a 100x100 image with red background:

However, it fails to create the image.
Actually, it generates a image file. But the image file is not the one expected; it generates a black background, and some "blue lines" on the top of the image, instead.
Does someone know what could be causing this?

Found the solution!
The script isn't generating a image file properly because It doesn't has a QImage.fill(). Upon declaring one, the script generates the image correctly.
The following script (a modified version of the first script I posted) does what I needed: