paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.92k stars 795 forks source link

Add sort button for the scene menu, remove `CategoriesSet` #348

Open zmoth opened 1 year ago

zmoth commented 1 year ago

I looked up where CategoriesSet is used in v2 and v3 and found that it is only used when creating menus. RegisteredModelsCategoryMap is perfectly capable of doing the job of CategoriesSet.

So I think the CategoriesSet can now be removed.

Please contact me if I have any incomplete considerations. Thanks.

paceholder commented 1 year ago

Your changes totally make sense.

What do you think about this one ? #147 And the corresponding PR https://github.com/paceholder/nodeeditor/pull/163

thanks

zmoth commented 1 year ago

Is there anything else you think we should recommend or improve? Thanks

zmoth commented 1 year ago

Sort button function

  auto ret = std::make_shared<NodeDelegateModelRegistry>();

  ret->registerModel<NumberSourceDataModel>("Sources");
  ret->registerModel<NumberDisplayDataModel>("Displays");
  ret->registerModel<AdditionModel>("Operators");
  ret->registerModel<SubtractionModel>("Operators");
  ret->registerModel<MultiplicationModel>("Operators");
  ret->registerModel<DivisionModel>("Operators");

imageimage