CodePudding user response:
QPixmap is designed to show the optimization, does not support pixel modified QImage is used for I/O and pixel read/modifyYou want to change some pixels, use first toImage into QImage, then can use QImage: : setPixel or QImage: : setPixelColor modify individual pixel color
I finished to use QPixmap: : fromImage from QImage to QPixmap
Or if you do not need to modify the former QPixmap, you can also directly by the QImage (const char * const [] XPM) to create a QImage