Hello Everyone,
I m displaying a .jpg file in a widget through QLabel and QScrollerArea Class .
But it does not display the .jpg files
My coding is as following ..........
imageLabel
->setBackgroundRole
(QPalette::Base);
imageLabel->setScaledContents(TRUE);
QImage image
(mediaPath
[currentIndex
]);
imageLabel
->setPixmap
(QPixmap::fromImage(image
));
imageLabel->resize(imageLabel->pixmap()->size());
scrollArea
->setBackgroundRole
(QPalette::Dark);
scrollArea->setWidget(imageLabel);
scrollArea->setWidgetResizable(TRUE);
QLabel *imageLabel;
imageLabel = new QLabel;
imageLabel->setBackgroundRole(QPalette::Base);
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
imageLabel->setScaledContents(TRUE);
QImage image(mediaPath[currentIndex]);
imageLabel->setPixmap(QPixmap::fromImage(image));
imageLabel->resize(imageLabel->pixmap()->size());
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(imageLabel);
scrollArea->setWidgetResizable(TRUE);
To copy to clipboard, switch view to plain text mode
If anyone has any idea please reply it.
Thanks in advance......................
Bookmarks