272 std::size_t Model::size() const |
272 std::size_t Model::size() const |
273 { |
273 { |
274 return this->body.size(); |
274 return this->body.size(); |
275 } |
275 } |
276 |
276 |
277 void save(const Model &model, QIODevice *device) |
277 void Model::clear() |
278 { |
278 { |
279 QTextStream out{device}; |
279 this->beginResetModel(); |
|
280 this->body.clear(); |
|
281 this->endResetModel(); |
|
282 } |
|
283 |
|
284 void save(const Model &model, QTextStream* stream) |
|
285 { |
280 for (std::size_t i = 0; i < model.size(); ++i) { |
286 for (std::size_t i = 0; i < model.size(); ++i) { |
281 out << modelElementToString(model[i]) << "\r\n"; |
287 (*stream) << modelElementToString(model[i]) << "\r\n"; |
282 } |
288 } |
283 } |
289 } |
284 |
290 |
285 /** |
291 /** |
286 * @brief Sets the path to the model |
292 * @brief Sets the path to the model |