bluetonic
29th September 2011, 14:37
Hi,
why my programm didn't show JPG? There is definitely wrong with my code.Can the expert help me figure it out.
Thx in advance
//@main.cpp
#include <QtGui/QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QImage myImage;
myImage.load("file:///home/ipan/test.JPG");
QLabel myLabel;
myLabel.setPixmap(QPixmap::fromImage(myImage));
myLabel.show();
return a.exec();
}
why my programm didn't show JPG? There is definitely wrong with my code.Can the expert help me figure it out.
Thx in advance
//@main.cpp
#include <QtGui/QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QImage myImage;
myImage.load("file:///home/ipan/test.JPG");
QLabel myLabel;
myLabel.setPixmap(QPixmap::fromImage(myImage));
myLabel.show();
return a.exec();
}