hi
I would like to have a scrollarea contains a dynamic count of images...

I tried to solve it like you see below. But the problem is that the scrollbar never appear...

My approach is:
I design with the QT desinger a ScrollArea (scrollArea) with default ScrollBarAsNeeded. Then I at also in the QT Designer a widget to the ScrollArea (named scrollContent).

Then in the Programm i tried:
Qt Code:
  1. QVBoxLayout* ScrollBoxLayout = new QVBoxLayout();
  2. ScrollBoxLayout->setSpacing(2);
  3. ScrollBoxLayout->setMargin(2);
  4. ScrollBoxLayout->setAlignment(Qt::AlignTop);
  5. ScrollBoxLayout->setSizeConstraint(QLayout::SetMinimumSize);
  6. ui.scrollArea->setLayout(ScrollBoxLayout);
To copy to clipboard, switch view to plain text mode 

and add the images like:
Qt Code:
  1. for (it=sig.begin(); it!=sig.end(); it++){
  2. //ignore this part
  3. image = QImage((uchar *) it->Image()->imageData, it->Image()->width, it->Image()->height,QImage::Format_RGB888);
  4. image = image.rgbSwapped();
  5.  
  6. //add qlabel to widget in scrollarea
  7. QLabel *img = new QLabel();
  8. ui.scrollArea->layout()->addWidget(img);
  9. img->setPixmap(QPixmap::fromImage(image));
  10. img->repaint();
  11. }
To copy to clipboard, switch view to plain text mode 

so the images appears like I wanted row by row... but no scrollbar appears if there are many QLabel objects added...

thx