src/model.cpp

changeset 159
1a04364d20b5
parent 158
5bd755eaa5a8
child 173
8a3047468994
equal deleted inserted replaced
158:5bd755eaa5a8 159:1a04364d20b5
156 { 156 {
157 const int position = static_cast<int>(this->body.size()); 157 const int position = static_cast<int>(this->body.size());
158 Q_EMIT this->beginInsertRows({}, position, position); 158 Q_EMIT this->beginInsertRows({}, position, position);
159 this->body.push_back(std::move(object)); 159 this->body.push_back(std::move(object));
160 Q_EMIT this->endInsertRows(); 160 Q_EMIT this->endInsertRows();
161 this->objectsById[object->id] = object.get(); 161 const ldraw::id_t id = this->body.back()->id;
162 return object->id; 162 this->objectsById[id] = this->body.back().get();
163 return id;
163 } 164 }
164 165
165 /** 166 /**
166 * @brief Removes the object at the specified position 167 * @brief Removes the object at the specified position
167 * @param position 168 * @param position

mercurial