Skip to content

Commit 7d43afa

Browse files
russelltgpaceholder
authored andcommitted
Add the uniqueModel in DataModelRegistry::registerModel to be an
optional parameter
1 parent 651ebcd commit 7d43afa

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/DataModelRegistry.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ class NODE_EDITOR_PUBLIC DataModelRegistry
3434

3535
template<typename ModelType>
3636
void
37-
registerModel()
37+
registerModel(std::unique_ptr<ModelType> uniqueModel = std::make_unique<ModelType>())
3838
{
3939
static_assert(std::is_base_of<NodeDataModel, ModelType>::value,
4040
"Must pass a subclass of NodeDataModel to registerModel");
4141

42-
auto uniqueModel = std::make_unique<ModelType>();
43-
4442
QString const name = uniqueModel->name();
4543

4644
if (_registeredModels.count(name) == 0)

0 commit comments

Comments
 (0)