Hello. I have QGridLayout inside of QScrollArea.
I'm trying to to add in it an image using this code:
Qt Code:
  1. QWidget *target = findChild<QWidget*>("imagesBoxContent");
  2. QGridLayout *targetLayout = target->findChild<QGridLayout*>("gridLayout");
  3. foreach (QString imagePath, list)
  4. {
  5. QLabel *newItem = new QLabel(target);
  6. newItem->setMinimumHeight(50);
  7. newItem->setMaximumHeight(50);
  8. newItem->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed);
  9. QImage image(imagePath);
  10. newItem->setPixmap(QPixmap::fromImage(image.scaledToHeight(50)));
  11. targetLayout->addWidget(newItem);
  12. }
To copy to clipboard, switch view to plain text mode 
And I get this result:
Снимок.PNG
But I'm trying to get this result:
Снимок_.jpg
How to make the QGridLayout create columns?