Ok let's say you have a program like structured like this:

CObject Objects in the table, like 25
CTable Table for QScrollArea
main where you display QScrollArea

In CTable you do this (assume all objects declared):

Qt Code:
  1. CTable::CTable(QWidget *parent) : QWidget(parent) {
  2. iObjects = 25;
  3. setLayout(lay);
  4. for(int i = 0; i < iObjects; i++){
  5. buttons << new QPushButtons(QString("%1").arg(i));
  6. }
  7. }
  8. void CTable::resizeEvent(QResizeEvent *evt){
  9. // ASSUME XPOS AND YPOS ARE CORRECTLY DECLARED
  10. for(int i = 0; i < iObjects; i++){
  11. buttons[i]->move(xpos*150+10, ypos*101+10);
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

And in main
Qt Code:
  1. qs->setWidget(ctable);
To copy to clipboard, switch view to plain text mode 


Code has been shortened for clarity!!!

The idea here is, I am building 25 custom widgets (I used buttons here for simplicity, with a QList), and they have to automatically resize and list themselves (the dimensions are 150 by 100), like as if you would see a test with problems in them. It will go like this:

1 2 3 4 5
6 7 8 9 10
11 12.....

Problem is when I compile this code, it will not show the objects, it will show them all in one spot (so all 25 are in same spot so you only see ONE).

Need help please.