chore(StatusQ/TestLib): TestModel::resetAndClear method added
This commit is contained in:
parent
b005a5606e
commit
05b47fb831
|
@ -134,6 +134,15 @@ void TestModel::reset()
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestModel::resetAndClear()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
std::for_each(m_data.begin(), m_data.end(), [](auto& e) {
|
||||||
|
e.second.clear();
|
||||||
|
});
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
void TestModel::initRoles()
|
void TestModel::initRoles()
|
||||||
{
|
{
|
||||||
m_roles.reserve(m_data.size());
|
m_roles.reserve(m_data.size());
|
||||||
|
|
|
@ -29,6 +29,9 @@ public:
|
||||||
// emits modelAboutToBeReset/modelReset, content remains the same
|
// emits modelAboutToBeReset/modelReset, content remains the same
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
// emits modelAboutToBeReset/modelReset, content is removed
|
||||||
|
void resetAndClear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initRoles();
|
void initRoles();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue