ShamusVW
9th June 2016, 16:21
Hi all
I am using QPixmap to load a blob/image from a database.
On one PC it works fine, however on a second PC not.
I did some troubleshooting, and it seems that on both PC's it is getting the data correctly from the database, however, on the QPixmap loadFromData function, it is returning false from the second PC.
The troubleshooting I did was to see if on the second PC it was failing on the query, however I am able to get the same ba.size() (the QbyteArray) from both of them.
I did initially try setting the header to jpg, but again without the second one showing an image (on a QLabel), so I just left it as default.
Can someone offer some clue why it would work differently on 2 PC's? Obviously the exact same executable, however on the one PC where it is working I am running Windows 8, on the 2nd I am running Windows Embedded (7).
This is the code I am using...
QByteArray ba = query.value(0).toByteArray();
outPixmap = QPixmap();
outPixmap.loadFromData(ba);
return outPixmap;
Unfortunately I am leaving work now, but I will be back in the morning.
Thank you.
I am using QPixmap to load a blob/image from a database.
On one PC it works fine, however on a second PC not.
I did some troubleshooting, and it seems that on both PC's it is getting the data correctly from the database, however, on the QPixmap loadFromData function, it is returning false from the second PC.
The troubleshooting I did was to see if on the second PC it was failing on the query, however I am able to get the same ba.size() (the QbyteArray) from both of them.
I did initially try setting the header to jpg, but again without the second one showing an image (on a QLabel), so I just left it as default.
Can someone offer some clue why it would work differently on 2 PC's? Obviously the exact same executable, however on the one PC where it is working I am running Windows 8, on the 2nd I am running Windows Embedded (7).
This is the code I am using...
QByteArray ba = query.value(0).toByteArray();
outPixmap = QPixmap();
outPixmap.loadFromData(ba);
return outPixmap;
Unfortunately I am leaving work now, but I will be back in the morning.
Thank you.