Hi,
I want to change the image size according to mainwindow size but it's go in a infinite cycle and after start stills increment the size.

#include "mainwindow.h"
#include <QtGui>

MainWindow::MainWindow(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *lay=new QHBoxLayout;
setLayout(lay);
image=new QImage("comando.jpg");
imageLabel = new QLabel(this);
lay->addWidget(imageLabel);
imageLabel->setPixmap(QPixmap::fromImage(image->scaled(400,400,Qt::KeepAspectRatio)));
}

MainWindow::~MainWindow()
{

}

void MainWindow::resizeEvent (QResizeEvent * event )
{
imageLabel->setPixmap(QPixmap::fromImage(image->scaled(size(),Qt::KeepAspectRatio)));
}