I read an image with:
Qt Code:
  1. QString fileName = QFileDialog::getOpenFileName(this,
  2. tr("Open File"), QDir::currentPath());
  3. if (!fileName.isEmpty()) {
  4. QImage image(fileName);
  5.  
  6. imageLabel->setPixmap(QPixmap::fromImage(image));
  7. scaleFactor = 1.0;
  8.  
  9. printAct->setEnabled(true);
  10. fitToWindowAct->setEnabled(true);
  11. updateActions();
  12.  
  13. if (!fitToWindowAct->isChecked())
  14. imageLabel->adjustSize();
  15. }
To copy to clipboard, switch view to plain text mode 
Now I want to change the values of the pixels of this image with new values. They are contained in an matrix[][] of int representing the same image equalized with my function.
The range of values in this matrix is 0-255.
I tried with:
Qt Code:
  1. for( int i = 0; i < r; i++ )
  2. for(int j = 0; j < c; j++)
  3. image.setPixel(j,i,(uint)matrix[i][j]);
To copy to clipboard, switch view to plain text mode 
but don't work, infact if I try to view it, I get a white image
Hepl me!!Thanks.