#ifndef MAINWINDOW_H
#define MAINWINDOW_H #include <QMainWindow>
#include <QLabel>
#include <QPixmap>
#include <QImage>
#include <QScrollArea> class MainWindow : public QMainWindow
{
Q_OBJECT public:
MainWindow(QWidget *parent = );
~MainWindow(); }; #endif // MAINWINDOW_H
#include "mainwindow.h" MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
this->resize(,);
this->centralWidget(); QLabel* label = new QLabel(this);
QImage image("01.jpg");
label->setPixmap(QPixmap::fromImage(image));
QScrollArea* area = new QScrollArea(this);
area->setWidget(label);
area->setBackgroundRole(QPalette::Dark);
area->setGeometry(,,image.width()+,image.height()-);
} MainWindow::~MainWindow()
{ }
#include "mainwindow.h"
#include <QApplication> int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show(); return a.exec();
}