Hi there!
This my first time on this forum.
I'm creating an application for an exam and I need to display a JPEG image in the application.
Here is the code:
#include <QApplication>
#include <QImageReader>
#include <QWidget>
{
public:
};
MyWidget
::MyWidget(QWidget *parent
) {
}
int main(int argc, char *argv[])
{
MyWidget widget;
widget.show();
return app.exec();
}
#include <QApplication>
#include <QImageReader>
#include <QWidget>
class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0);
QImageReader *lettore;
};
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
lettore=new QImageReader("k8055.jpg");
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyWidget widget;
widget.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I'm using QT 4.2.3 Open Source with Visual Studio 2005.
When I run the application I see a blank dialog with the same image size. Where is the mistake? Can you help me?
PS. Sorry for bad english but I am Italian
Bookmarks