Hi,
I need to write a function that accept QImage as an input. I declared QImage pointer as
QImage *image;
And create a new image and set this pointer as
QImage img("path to image file");
image = &img;
And I have a function like this
somefunction(QImage *image)
{
ui->imgLabel->setPixmap(QPixmap::fromImage(*image)); // This line gives an arithmetic exception why?
}
It compiles without any error, but get an arithmetic exception at ui->imgLabel->setPixmap(QPixmap::fromImage(*image));
Also please let me know the difference between
somefunction(QImage *image)
and somefunction(QImage &image)
Thanking you,
Ras
↧