A lot of things are wrong in your program:
- you assume your images have 32 bit depth;
- your compare the first pixel of each row, regardless of the width of the images;
- in fact you print a statement about the equality of the image for each row;
- the two indices i and j in the loop are always the same.

I would recommend:
- learning how to use pointers and arrays in C++;
- thinking about your algorithm before writing any code;
- using QImage::operator==().