Dear Everyone,
How can we display a jpg file in a widget.
I m using following code but there is no output .....
QLabel *imageLabel;
imageLabel = new QLabel(this,0);
imageLabel->setGeometry ( locx,locy,w,h );
imageLabel->setBackgroundRole(QPalette::Base);
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
imageLabel->setScaledContents(true);
QImage image(mediaPath[currentIndex]);
if (!image.isNull())
{
qDebug()<<"Image"<<mediaPath[currentIndex];
}
imageLabel->setPixmap(QPixmap::fromImage(image));

Please if you have any idea about it give reply.
Thanks: