Make a copie of previous table model when unlink a table from her previous table.

This commit is contained in:
Claveau Joshua
2020-06-04 14:17:14 +02:00
parent 8ad876fb31
commit ae9ef3cf21
3 changed files with 18 additions and 3 deletions

View File

@@ -39,6 +39,19 @@ NomenclatureModel::NomenclatureModel(QETProject *project, QObject *parent) :
connect(m_project->dataBase(), &projectDataBase::dataBaseUpdated, this, &NomenclatureModel::dataBaseUpdated);
}
/**
* @brief NomenclatureModel::NomenclatureModel
* @param other_model
*/
NomenclatureModel::NomenclatureModel(const NomenclatureModel &other_model)
{
this->setParent(other_model.parent());
m_project = other_model.m_project;
connect(m_project->dataBase(), &projectDataBase::dataBaseUpdated, this, &NomenclatureModel::dataBaseUpdated);
m_index_0_0_data = other_model.m_index_0_0_data;
query(other_model.queryString());
}
/**
* @brief NomenclatureModel::rowCount
* Reimplemented for QAbstractTableModel
@@ -346,5 +359,6 @@ void NomenclatureModel::fillValue()
++i;
}
m_record << record_;
}
}