Hi
I have a cod like this,

QIcon icon;
QStringList files;
QStringList filters;
QString fileName;
int r, c;
filters << "snapshot-*" ;
QDir directory;
directory.setNameFilters(filters);
files = directory.entryList(filters, QDir::Files | QDir::NoSymLinks);
NumStates_New=0;
NumStates_New = files.size()/3;
if ( files.size()%3 >0 ) NumStates_New++;
QLabel *pixmapLabels [NumStates_New] [3];
QScrollArea *scrollArea = new QScrollArea ( SnapWindow );
scrollArea->setBackgroundRole(QPalette:ark);
scrollArea->setGeometry(5,5, 340, 550);

SnapLayout = new QGridLayout(scrollArea);
for (int i = 0; i < NumStates_New; ++i) {
for (int j = 0; j < 3; ++j) {
pixmapLabels[i][j] = createPixmapLabel();
SnapLayout->addWidget(pixmapLabels[i][j], i + 1, j + 1 );
} }

QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(SnapWindow);
r=0, c=0;
for (int i = 0; i < files.size(); ++i) {
fileName = files.at(i).toLocal8Bit().constData();
QImage image(fileName);
if (!image.isNull())
icon.addPixmap(QPixmap::fromImage(image), QIcon::Active, QIcon::On);
this->icon = icon;
this->size = QSize(128,128);
QPixmap pixmap = icon.pixmap(size, QIcon::Active, QIcon::On);
pixmapLabels[r][c]->setPixmap(pixmap);
c++;
if (c>=3) {
c=0; r++;
} }


It display all the pictures in a widget. I need a scrolbar for the QScrollArea. In this code the scroll bar not display, and all pictures shrink to that QScrollArea. Please help me for adding a scrollbar in this code.