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...
void MatrixOP::createGridMatrixValues(int size)
{
setMatrixValues
= new QGroupBox (tr
("Input Values"));
qDebug()<<size;
for(int j=1; j<=size+1;j++){
QVector<QLineEdit *> foo;
for (int i=1; i<=size+1;i++){
foo.append(value);
layout->addWidget(value, j, i);
}
vectorOfVectorOfLineEdits.append(foo);
}
setMatrixValues->setLayout(layout);
}
void MatrixOP::on_changeIndex_chooseSize(int index)
{
vectorOfVectorOfLineEdits.clear();
createGridMatrixValues(index);
}
void MatrixOP::createGridMatrixValues(int size)
{
setMatrixValues = new QGroupBox (tr("Input Values"));
QGridLayout *layout = new QGridLayout;
qDebug()<<size;
for(int j=1; j<=size+1;j++){
QVector<QLineEdit *> foo;
for (int i=1; i<=size+1;i++){
QLineEdit *value =new QLineEdit(this);
foo.append(value);
layout->addWidget(value, j, i);
}
vectorOfVectorOfLineEdits.append(foo);
}
setMatrixValues->setLayout(layout);
}
void MatrixOP::on_changeIndex_chooseSize(int index)
{
vectorOfVectorOfLineEdits.clear();
createGridMatrixValues(index);
}
To copy to clipboard, switch view to plain text mode
Bookmarks