ChangeId.hpp
1 #pragma once
2 #include <score/model/IdentifiedObject.hpp>
3 
4 namespace score
5 {
6 namespace IDocument
7 {
8 
9 template <typename T>
10 void changeObjectId(IdentifiedObject<T>& obj, const Id<T>& new_id)
11 {
12  obj.setId(new_id);
13  const auto& cld = ((QObject&)obj).findChildren<IdentifiedObjectAbstract*>();
14  for(auto child : cld)
15  child->resetCache();
16 }
17 }
18 }
Base class for IdentifiedObject.
Definition: IdentifiedObjectAbstract.hpp:16
The id_base_t class.
Definition: Identifier.hpp:57
Base toolkit upon which the software is built.
Definition: Application.cpp:90