I am not sure whether this works properly but here is what came to my mind. I assume Grid is a widget since you didn't furnish these details.

Qt Code:
  1. class Grid : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. Grid(QWidget *par) : QWidget(par)
  6. {
  7. curRow = 0;
  8. curCol = 0;
  9. timer = new QTimer(this);
  10. timer.setSingleShot(true);
  11. connect(timer,SIGNAL(timeout()),this,SLOT(fillGrid()));
  12. }
  13.  
  14. public slots:
  15. // This slot connected to push button's clicked signal
  16. void fillGrids()
  17. {
  18. timer.start(100);
  19. }
  20.  
  21. void fillGrid()
  22. {
  23. grid[curRow][curCol].fill(); // This is just pseudo code
  24. curRow++,curCol++;
  25. if(curRow >= MAX_ROWS || curCol >= MAX_COLS)
  26. return;
  27. timer.start(100);
  28. }
  29. ...
  30. }
To copy to clipboard, switch view to plain text mode 

I may be wrong since I cant test this at the moment. Please do correct me if anything is wrong.