我在 QGraphicsView 中有一个 QImage ,我需要连续显示图像。有时我需要连续显示倒置的图像。为此,我使用
img.invertPixels(QImage::InvertRgba); 
但是此时,由于连续的反转过程,显示正在闪烁。如何在不影响性能的情况下实现反相过程?显示似乎很平滑,没有反转。`
QImage img(byImageBuf, width, height, QImage::Format_Indexed8);   
  scene->clear();        
 if(bInvertPixel)       
 {   
    /* Inverted image */        
     img.invertPixels(QImage::InvertRgba);      
 }        
 scene->addPixmap(QPixmap::fromImage(img));     
 view->fitInView(0, 0, width, height,  Qt::IgnoreAspectRatio);        
 view->update();`