Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Passing QImage to a function

$
0
0
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

Viewing all articles
Browse latest Browse all 18427

Trending Articles