The function is declared as const: ModellerFileModel::data(const QModelIndex &index, int role) const and it modifies state of the object (the map that is part of the object), to fix it you can drop const from function definition (because it's misleading) or add mutable to the QMap declaration (so that it can be modified in const member functions), the correct solution is the first one.
Bookmarks