Howdy!
I need some help being able to read and write float* and unsigned char* as BLOBs in mySQL. I understand how to read and write a QVariant as a BLOB using QT but I'm not sure of the best way to put these arrays into QVariants or how to retrieve a float* or unsigned char* from a QVariant when retrieving the BLOB from the database.
Both the float* and unsigned char* are images output from VTK. I tried doing the following as a test to go to a QVariant and back but the resulting image is not correct (data != dataOut). I'm sure that there has to be a better way to approach this.
Qt Code:
QList<unsigned char> *image = new QList<unsigned char>(); for(int i = 0; i < memsize/sizeof(unsigned char); i++) { image->append(data[i]); } unsigned char *dataOut = image->toVector().data();To copy to clipboard, switch view to plain text mode
Bookmarks