thanks for the help, i change my array w/ a Qvector<qvector<qlineEdit>> array but i still cant figure out how to use qDeleteAll() to remove the created widgets and add a new ones...

Qt Code:
  1. void MatrixOP::createGridMatrixValues(int size)
  2. {
  3. setMatrixValues = new QGroupBox (tr("Input Values"));
  4. QGridLayout *layout = new QGridLayout;
  5. qDebug()<<size;
  6. for(int j=1; j<=size+1;j++){
  7. QVector<QLineEdit *> foo;
  8. for (int i=1; i<=size+1;i++){
  9. QLineEdit *value =new QLineEdit(this);
  10. foo.append(value);
  11. layout->addWidget(value, j, i);
  12. }
  13. vectorOfVectorOfLineEdits.append(foo);
  14. }
  15.  
  16. setMatrixValues->setLayout(layout);
  17. }
  18. void MatrixOP::on_changeIndex_chooseSize(int index)
  19. {
  20. vectorOfVectorOfLineEdits.clear();
  21. createGridMatrixValues(index);
  22. }
To copy to clipboard, switch view to plain text mode