--- a/src/model.cpp Thu Feb 15 11:34:04 2018 +0200 +++ b/src/model.cpp Thu Feb 15 12:18:57 2018 +0200 @@ -638,6 +638,17 @@ return nullptr; } +QModelIndex Model::indexFromId(qint32 id) const +{ + for (int row = 0; row < this->size(); ++row) + { + if (this->objects()[row]->id() == id) + return index(row); + } + + return {}; +} + int countof(Model& model) { return model.size();