Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QImage and Warning C4267 'argument' : conversion from 'size_t' to 'int', possible loss of data?
jh224 last edited by
I've done research on this warning and it seems common and pretty harmless. I was wondering if anyone had insight why the following line generates this warning? Also, how do I change it to make the warning to go away? I am assuming that col, row and step are causing this warning.
QImage img(buffer, rgb.col, rgb.row, rgb.step, QImage::Format_RGB888);
Buckets last edited by
size_t is an unsigned int type so there might be an issue when you are dealing with large numbers (greater than 0x80000000). To get rid of that warning use a signed int.