im trying to create a matrix grid that changes its size when an option in the combobox is selected, i dont know how to call the function that creates the grid everytime i change the value of the combo box...



Qt Code:
  1. void MatrixOP::createGridMatrixSize()
  2. {
  3. setMatrixSize=new QGroupBox(tr("Select Size"));
  4. QGridLayout *layout =new QGridLayout;
  5. QLabel *sizeLabel = new QLabel(tr("Size"));
  6. QComboBox *chooseSize = new QComboBox;
  7. chooseSize->addItems(QStringList()<<"0"<<"1"<<"2"<<"3"<<"4"<<"5"<<"6"<<"7"<<"8"<<"9"<<"10");
  8. chooseSize->setCurrentIndex(1);
  9. layout->addWidget(sizeLabel, 0,0);
  10. layout->addWidget(chooseSize, 0,1);
  11. setMatrixSize->setLayout(layout);
  12. }
  13.  
  14. void MatrixOP::createGridMatrixValues()
  15. {
  16. int gridSize=chooseSize->currentIndex();
  17. setMatrixValues = new QGroupBox (tr("Input Values"));
  18. QGridLayout *layout = new QGridLayout;
  19. for(int j=1; j<=gridSize;j++){
  20. for (int i=1; i<=gridSize;i++){
  21. matrixValues[i]=new QLineEdit;
  22. layout->addWidget(matrixValues[i], j, i+1);
  23. }
  24. }
  25. setMatrixValues->setLayout(layout);
  26.  
  27. }
To copy to clipboard, switch view to plain text mode 

i believe it can be done with SIGNALS and SLOTS but i cant figure out the way to refresh the mainwindow to "redraw" the grid....any help?thx